summary refs log tree commit diff
path: root/nq.c
diff options
context:
space:
mode:
Diffstat (limited to 'nq.c')
-rw-r--r--nq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/nq.c b/nq.c
index 9b8b692..6fe739c 100644
--- a/nq.c
+++ b/nq.c
@@ -209,6 +209,9 @@ usage:
 	/* drop leading '.' */
 	renameat(dirfd, lockfile, dirfd, lockfile+1);
 
+	/* block until rename is committed */
+	fsync(dirfd);
+
 	write_execline(lockfd, argc, argv);
 
 	dup2(lockfd, 2);