aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/daemon.c2
1 files changed, 1 insertions, 1 deletions
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: