X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ffailtest%2Ffailtest.c;h=a0c825399d03881ab0338075a0a46fb2c4ec1898;hp=1dad0864aa372fa3b7ead07a081f9e125f192bbc;hb=2006aa032d6f72599165e50242d06df35428d43a;hpb=e43dc84fe91f64d8761aeda6338a1afbf701b7f5 diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c index 1dad0864..a0c82539 100644 --- a/ccan/failtest/failtest.c +++ b/ccan/failtest/failtest.c @@ -488,7 +488,10 @@ static NORETURN void failtest_cleanup(bool forced_cleanup, int status) } free_everything(); - tell_parent(SUCCESS); + if (status == 0) + tell_parent(SUCCESS); + else + tell_parent(FAILURE); exit(status); } @@ -515,8 +518,8 @@ static bool should_fail(struct failtest_call *call) } else { if (tolower((unsigned char)*failpath) != info_to_arg[call->type]) - errx(1, "Failpath expected '%c' got '%c'\n", - info_to_arg[call->type], *failpath); + errx(1, "Failpath expected '%s' got '%c'\n", + failpath, info_to_arg[call->type]); call->fail = cisupper(*(failpath++)); return call->fail; }