Patchwork [08/14] net/slirp.c: fix warning with _FORTIFY_SOURCE

login
register
mail settings
Submitter Kirill A. Shutemov
Date Dec. 31, 2009, 1:33 a.m.
Message ID <1262223199-19062-8-git-send-email-kirill@shutemov.name>
Download mbox | patch
Permalink /patch/41954/
State New
Headers show

Comments

Kirill A. Shutemov - Dec. 31, 2009, 1:33 a.m.
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 <kirill@shutemov.name>
---
 net/slirp.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Patch

diff --git a/net/slirp.c b/net/slirp.c
index 3f91c4b..2bd8a8f 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -464,10 +464,17 @@  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 == -1) {
+            perror("system()");
+        } else if (WEXITSTATUS(ret)) {
+            qemu_error("'%s' failed. Error code: %d\n"
+                    cmd, WEXITSTATUS(ret));
+        }
         s->smb_dir[0] = '\0';
     }
 }