aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-11-28 10:39:00 -0800
committerGravatar Mark D. Roth <roth@google.com>2016-11-28 10:39:00 -0800
commit491d97546c54ad1192968bbf8505d0db6e3b983e (patch)
tree389974c7778511898a5d600e188abcfc99736021
parentea7136bb430474192d861894c587601be6181d8f (diff)
Fix subprocess code to avoid redundant calls to waitpid().
-rw-r--r--src/core/lib/support/subprocess_posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/support/subprocess_posix.c b/src/core/lib/support/subprocess_posix.c
index 4f4de9298e..daf371d03e 100644
--- a/src/core/lib/support/subprocess_posix.c
+++ b/src/core/lib/support/subprocess_posix.c
@@ -40,6 +40,7 @@
#include <assert.h>
#include <errno.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -52,7 +53,7 @@
struct gpr_subprocess {
int pid;
- int joined;
+ bool joined;
};
const char *gpr_subprocess_binary_extension() { return ""; }
@@ -100,6 +101,7 @@ retry:
gpr_log(GPR_ERROR, "waitpid failed: %s", strerror(errno));
return -1;
}
+ p->joined = true;
return status;
}