From eb7ad5609d1147c3ac20ec167af8b002723eb03a Mon Sep 17 00:00:00 2001 From: Guru Prasad Srinivasa Date: Tue, 8 Mar 2016 18:53:33 -0500 Subject: [PATCH] Make forktest fail if waitpid() fails Previously, forktest would only warn if the calls to waitpid() returned errors. Now, forktest terminates on the first error. --- userland/testbin/forktest/forktest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userland/testbin/forktest/forktest.c b/userland/testbin/forktest/forktest.c index 82b44a0..bcefe62 100644 --- a/userland/testbin/forktest/forktest.c +++ b/userland/testbin/forktest/forktest.c @@ -133,13 +133,13 @@ dowait(int nowait, int pid) if (!nowait) { if (waitpid(pid, &x, 0)<0) { - warn("waitpid"); + errx(1, "waitpid"); } else if (WIFSIGNALED(x)) { - warnx("pid %d: signal %d", pid, WTERMSIG(x)); + errx(1, "pid %d: signal %d", pid, WTERMSIG(x)); } else if (WEXITSTATUS(x) != 0) { - warnx("pid %d: exit %d", pid, WEXITSTATUS(x)); + errx(1, "pid %d: exit %d", pid, WEXITSTATUS(x)); } } }