aboutsummaryrefslogtreecommitdiff
path: root/net/slirp.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-03-04 10:00:31 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-09 11:23:00 -0600
commit24ac07dec7f23c58dc48aa7754f872781b386d46 (patch)
treed3fd89fe264d656e59517292b481a2b183e70fb6 /net/slirp.c
parent48b66db9ea19e30ac360872dae590e79cd009d1a (diff)
slirp: check system() success
we shouldn't call W*() macros until we check that fork worked. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/slirp.c')
-rw-r--r--net/slirp.c2
1 files changed, 1 insertions, 1 deletions
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",