* 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.
This commit is contained in:
Jan Kratochvil
2011-06-07 17:26:47 +00:00
parent f36485f09d
commit 5be4dfca58
6 changed files with 78 additions and 4 deletions

View File

@@ -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. */