diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-27 13:59:06 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-27 13:59:06 +0200 |
commit | 0bbe2e436fc51df3091e28464dfac2f6d3bf5f38 (patch) | |
tree | 56c7a3fb418138ea07c9f25c68f0b52a8bc7b28b | |
parent | be322c569708ed17cc53c068d89d3bb755cb354f (diff) | |
download | nq-0bbe2e436fc51df3091e28464dfac2f6d3bf5f38.tar.gz nq-0bbe2e436fc51df3091e28464dfac2f6d3bf5f38.tar.xz nq-0bbe2e436fc51df3091e28464dfac2f6d3bf5f38.zip |
nq: fsync after rename
For details, see https://groups.google.com/forum/#!topic/comp.unix.programmer/AM2V83RCOVE
-rw-r--r-- | nq.c | 3 |
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); |