[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/18] net/slirp.c: fix warning with _FORTIFY_S
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 10/18] net/slirp.c: fix warning with _FORTIFY_SOURCE |
Date: |
Tue, 22 Dec 2009 18:50:15 +0000 |
On Sun, Dec 20, 2009 at 1:39 AM, Kirill A. Shutemov
<address@hidden> wrote:
> CC net/slirp.o
> cc1: warnings being treated as errors
> net/slirp.c: In function 'slirp_smb_cleanup':
> net/slirp.c:470: error: ignoring return value of 'system', declared with
> attribute warn_unused_result
> make: *** [net/slirp.o] Error 1
>
> Signed-off-by: Kirill A. Shutemov <address@hidden>
> ---
> net/slirp.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/net/slirp.c b/net/slirp.c
> index 3f91c4b..1f16814 100644
> --- a/net/slirp.c
> +++ b/net/slirp.c
> @@ -464,10 +464,15 @@ int net_slirp_redir(const char *redir_str)
> static void slirp_smb_cleanup(SlirpState *s)
> {
> char cmd[128];
> + int ret;
>
> if (s->smb_dir[0] != '\0') {
> snprintf(cmd, sizeof(cmd), "rm -rf %s", s->smb_dir);
> - system(cmd);
> + ret = system(cmd);
> + if (ret) {
> + qemu_error("'%s' failed. Error code: %d\n", cmd, ret);
> + /* abort() ? */
This is not correct.
- system() returns -1 on error and the command exit status otherwise,
which may also be nonzero.
- the exit status should be retrieved with WEXITSTATUS() macro, or in
case of error via errno.
- in no case abort() is warranted for smb cleanup.
- [Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE, (continued)
- [Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 15/18] monitor.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 16/18] hw/pc.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 18/18] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- Re: [Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 16/18] hw/pc.c: fix warnings with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 11/18] usb-linux.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 10/18] net/slirp.c: fix warning with _FORTIFY_SOURCE,
Blue Swirl <=
- [Qemu-devel] Re: [PATCH 09/18] block/qcow2.c: fix warnings with _FORTIFY_SOURCE, Andreas Schwab, 2009/12/20
- Re: [Qemu-devel] [PATCH 08/18] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kevin Wolf, 2009/12/20
- Re: [Qemu-devel] [PATCH 07/18] block/bochs.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 03/18] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE, Paul Brook, 2009/12/20
Re: [Qemu-devel] [PATCH 02/18] block.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
Re: [Qemu-devel] [PATCH 01/18] Do not disable _FORTIFY_SOURCE, Blue Swirl, 2009/12/20