aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/cli/cli-cmds.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index ea2e156..65ac7d6 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -55,6 +55,7 @@
#include "extension.h"
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/gdb_tilde_expand.h"
+#include "gdbsupport/eintr.h"
#ifdef TUI
#include "tui/tui.h"
@@ -921,7 +922,11 @@ run_under_shell (const char *arg, int from_tty)
}
if (pid != -1)
- waitpid (pid, &status, 0);
+ {
+ int ret = gdb::handle_eintr (-1, ::waitpid, pid, &status, 0);
+ if (ret == -1)
+ perror_with_name ("Cannot get status of shell command");
+ }
else
error (_("Fork failed"));
return status;