From 24ac07dec7f23c58dc48aa7754f872781b386d46 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Thu, 4 Mar 2010 10:00:31 +0100 Subject: slirp: check system() success we shouldn't call W*() macros until we check that fork worked. Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/slirp.c b/net/slirp.c index 317cca7f63..7f846ec6f9 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -472,7 +472,7 @@ static void slirp_smb_cleanup(SlirpState *s) if (s->smb_dir[0] != '\0') { snprintf(cmd, sizeof(cmd), "rm -rf %s", s->smb_dir); ret = system(cmd); - if (!WIFEXITED(ret)) { + if (ret == -1 || !WIFEXITED(ret)) { qemu_error("'%s' failed.\n", cmd); } else if (WEXITSTATUS(ret)) { qemu_error("'%s' failed. Error code: %d\n", -- cgit v1.2.3