From 5069685c5ec19f6d29cb0bd5eefd534c617119cc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Feb 2011 23:27:43 +1030 Subject: [PATCH 1/1] failtest: be clearer when child times out. ie. SIGUSR1 means it timed out. --- ccan/failtest/failtest.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c index ad7e0fea..dcf034cc 100644 --- a/ccan/failtest/failtest.c +++ b/ccan/failtest/failtest.c @@ -455,9 +455,13 @@ static bool should_fail(struct failtest_call *call) close(output[0]); close(control[0]); waitpid(child, &status, 0); - if (!WIFEXITED(status)) - child_fail(out, outlen, "Killed by signal %u: ", - WTERMSIG(status)); + if (!WIFEXITED(status)) { + if (WTERMSIG(status) == SIGUSR1) + child_fail(out, outlen, "Timed out"); + else + child_fail(out, outlen, "Killed by signal %u: ", + WTERMSIG(status)); + } /* Child printed failure already, just pass up exit code. */ if (type == FAILURE) { fprintf(stderr, "%.*s", (int)outlen, out); -- 2.39.2