From: Rusty Russell Date: Mon, 29 Aug 2011 23:52:39 +0000 (+0930) Subject: failtest: replay --failpath correctly on really failing opens. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=adc9909e26f96eec2c6846aa4085551af59979cf failtest: replay --failpath correctly on really failing opens. When an open() call fails, we don't inject an error, but we didn't apply this logic when replaying a failpath, with strange results. --- diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c index bac0aa35..f79768d8 100644 --- a/ccan/failtest/failtest.c +++ b/ccan/failtest/failtest.c @@ -701,7 +701,7 @@ int failtest_open(const char *pathname, free((char *)call.pathname); p->u.open.ret = open(pathname, call.flags, call.mode); - if (!failpath && p->u.open.ret == -1) { + if (p->u.open.ret == -1) { p->fail = false; p->error = errno; } else if (should_fail(p)) {