diff options
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r-- | gdb/cli/cli-cmds.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 7fd2f50..d4b29a21 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -726,7 +726,7 @@ shell_escape (char *arg, int from_tty) chdir (current_directory); #endif #else /* Can fork. */ - int rc, status, pid; + int status, pid; if ((pid = vfork ()) == 0) { @@ -750,8 +750,7 @@ shell_escape (char *arg, int from_tty) } if (pid != -1) - while ((rc = wait (&status)) != pid && rc != -1) - ; + waitpid (pid, &status, 0); else error (_("Fork failed")); #endif /* Can fork. */ |