summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils_launcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/shell_utils_launcher.cpp')
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index d69bdc6452b..b95e814777e 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -656,7 +656,10 @@ bool wait_for_pid(ProcessId pid, bool block = true, int* exit_code = NULL) {
}
#else
int tmp;
- bool ret = (pid.toNative() == waitpid(pid.toNative(), &tmp, (block ? 0 : WNOHANG)));
+ int ret;
+ do {
+ ret = waitpid(pid.toNative(), &tmp, (block ? 0 : WNOHANG));
+ } while (ret == -1 && errno == EINTR);
if (ret && exit_code) {
if (WIFEXITED(tmp)) {
*exit_code = WEXITSTATUS(tmp);
@@ -666,7 +669,7 @@ bool wait_for_pid(ProcessId pid, bool block = true, int* exit_code = NULL) {
MONGO_UNREACHABLE;
}
}
- return ret;
+ return ret == pid.toNative();
#endif
}