From: Rusty Russell Date: Tue, 15 Feb 2011 12:57:43 +0000 (+1030) Subject: failtest: be clearer when child times out. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=5069685c5ec19f6d29cb0bd5eefd534c617119cc;hp=df34919b32720329544195900ce57f1a229842f8;ds=sidebyside failtest: be clearer when child times out. ie. SIGUSR1 means it timed out. --- 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);