From 9975a26bad25cdefaefb52705fed76b0baae9ec5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 1 Mar 2011 11:22:56 +1030 Subject: [PATCH] failtest: fix locking code. We need to get the locks back *after* the child runs. --- ccan/failtest/failtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/failtest/failtest.c b/ccan/failtest/failtest.c index 7d842d80..e2e6c64f 100644 --- a/ccan/failtest/failtest.c +++ b/ccan/failtest/failtest.c @@ -983,7 +983,6 @@ int failtest_fcntl(int fd, const char *file, unsigned line, int cmd, ...) } p = add_history(FAILTEST_FCNTL, file, line, &call); - get_locks(); if (should_fail(p)) { p->u.fcntl.ret = -1; @@ -992,6 +991,7 @@ int failtest_fcntl(int fd, const char *file, unsigned line, int cmd, ...) else p->error = EDEADLK; } else { + get_locks(); p->u.fcntl.ret = fcntl(p->u.fcntl.fd, p->u.fcntl.cmd, &p->u.fcntl.arg.fl); if (p->u.fcntl.ret == -1) -- 2.39.2