summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-03-28 14:28:22 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-03-28 14:28:22 +1030
commit3ad57bc902f31ba347df59de04168f00c626d924 (patch)
tree39d306990d53a6e8dc32c61a406326cbca21f66e
parent024fbb5f9682d3187b65849948c372c3879ed9bd (diff)
failtest: continue (without failing) if we run off end of --failpath=
This is important because we tell people to use --failpath to reproduce a failure, but the fail path we list only goes up to the last failure injection if the child dies, for example. Thanks to David Gibson for prodding me to fix this...
-rw-r--r--ccan/failtest/failtest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c
index 7a6f5220..b25b049e 100644
--- a/ccan/failtest/failtest.c
+++ b/ccan/failtest/failtest.c
@@ -364,7 +364,10 @@ static bool should_fail(struct failtest_call *call)
/* + means continue after end, like normal. */
if (*failpath == '+')
failpath = NULL;
- else {
+ else if (*failpath == '\0') {
+ /* Continue, but don't inject errors. */
+ return call->fail = false;
+ } else {
if (tolower((unsigned char)*failpath)
!= info_to_arg[call->type])
errx(1, "Failpath expected '%c' got '%c'\n",