mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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>
This commit is contained in:
parent
48b66db9ea
commit
24ac07dec7
1 changed files with 1 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue