diff options
author | Juan Quintela <quintela@redhat.com> | 2010-03-04 10:00:31 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-09 11:23:00 -0600 |
commit | 24ac07dec7f23c58dc48aa7754f872781b386d46 (patch) | |
tree | d3fd89fe264d656e59517292b481a2b183e70fb6 /net | |
parent | 48b66db9ea19e30ac360872dae590e79cd009d1a (diff) | |
download | qemu-24ac07dec7f23c58dc48aa7754f872781b386d46.zip qemu-24ac07dec7f23c58dc48aa7754f872781b386d46.tar.gz qemu-24ac07dec7f23c58dc48aa7754f872781b386d46.tar.bz2 |
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')
-rw-r--r-- | net/slirp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/slirp.c b/net/slirp.c index 317cca7..7f846ec 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", |