summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-13 11:46:04 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-13 11:46:04 -0400
commitd44eb16b23829299f154e46984bf4be0d5036dea (patch)
tree073c12052d5f8c82578407fa42548ffd00a20cb3 /src/ext
parent4b646e30d8364e56fb6ae4ce5850f01e714eabcb (diff)
parent3ddfd5ff25b1319dee3a013c8dac02ff9121971e (diff)
downloadtor-d44eb16b23829299f154e46984bf4be0d5036dea.tar.gz
tor-d44eb16b23829299f154e46984bf4be0d5036dea.zip
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/tinytest.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c
index 052fb6483f..16f11e4639 100644
--- a/src/ext/tinytest.c
+++ b/src/ext/tinytest.c
@@ -218,12 +218,20 @@ testcase_run_forked_(const struct testgroup_t *group,
r = (int)read(outcome_pipe[0], b, 1);
if (r == 0) {
printf("[Lost connection!] ");
- return 0;
+ return FAIL;
} else if (r != 1) {
perror("read outcome from pipe");
}
- waitpid(pid, &status, 0);
+ r = waitpid(pid, &status, 0);
close(outcome_pipe[0]);
+ if (r == -1) {
+ perror("waitpid");
+ return FAIL;
+ }
+ if (! WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ printf("[did not exit cleanly.]");
+ return FAIL;
+ }
return b[0]=='Y' ? OK : (b[0]=='S' ? SKIP : FAIL);
}
#endif