diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-07 17:26:41 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-07 17:26:41 +0000 |
commit | f8c852aa780f6b53c0576cfbcd326413a59680bc (patch) | |
tree | 2ae651f88dee1bbfc6519fca6c26ef00e6f7c52e /gdb/cli/cli-cmds.c | |
parent | 90ed58afe1256fbb9d8df73e90bb84c9c913f3f3 (diff) | |
download | gdb-f8c852aa780f6b53c0576cfbcd326413a59680bc.tar.gz |
gdb/
* cli/cli-cmds.c (shell_escape): Use waitpid.
* rs6000-nat.c (exec_one_dummy_insn): Likewise.
gdb/testsuite/
* gdb.base/async-shell.c: New file.
* gdb.base/async-shell.exp: New file.
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 7fd2f503980..d4b29a213d4 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. */ |