From 8a8059409e67173d6767bcc1b394f27545157649 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 29 Dec 2015 05:25:14 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon.c b/src/daemon.c index edc230c..56fb682 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -363,7 +363,6 @@ found_it: t (ftruncate(STATE_FILENO, (size_t)r + off)); free(buf), buf = NULL; fsync(STATE_FILENO); - flock(STATE_FILENO, LOCK_UN); if (runjob) { run_job_or_hook(job_full, runjob == 2 ? "expired" : "forced"); @@ -378,6 +377,7 @@ found_it: free(job_full); } + flock(STATE_FILENO, LOCK_UN); /* Unlock late so that hooks are synchronised. */ return rc; fail: -- cgit v1.2.3-70-g09d2