aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-06-07 17:26:47 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-06-07 17:26:47 +0000
commit5be4dfca585c6713617a2773394ef98a4e9f3c9c (patch)
tree9c3e1ba3ac7a235add4dbab7e120fadfb7723c6a /gdb/cli
parentf36485f09d638d253ee09de07950dd7b85a2d99e (diff)
downloadgdb-5be4dfca585c6713617a2773394ef98a4e9f3c9c.zip
gdb-5be4dfca585c6713617a2773394ef98a4e9f3c9c.tar.gz
gdb-5be4dfca585c6713617a2773394ef98a4e9f3c9c.tar.bz2
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')
-rw-r--r--gdb/cli/cli-cmds.c5
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. */