]> Sergey Matveev's repositories - public-inbox.git/commit - devel
lei: use RENAME_NOREPLACE on Linux 3.15+
authorEric Wong <e@80x24.org>
Thu, 21 Oct 2021 21:10:32 +0000 (21:10 +0000)
committerEric Wong <e@80x24.org>
Fri, 22 Oct 2021 00:54:51 +0000 (00:54 +0000)
commit4cd7a78f3b8c03670e2d77675229472506eee1eb
tree2a0e89de3e77b70962e509d41883518fb6574dde
parent2c354e17694da744c6dc1ab19c14af3d456b28bb
lei: use RENAME_NOREPLACE on Linux 3.15+

One syscall is better than two for atomicity in Maildirs.  This
means there's no window where another process can see both the
old and new file at the same time (link && unlink), nor a window
where we might inadvertantly clobber an existing file if we were
to do `stat && rename'.
MANIFEST
devel/syscall-list
lib/PublicInbox/LeiExportKw.pm
lib/PublicInbox/LeiStore.pm
lib/PublicInbox/LeiToMail.pm
lib/PublicInbox/Syscall.pm
t/rename_noreplace.t [new file with mode: 0644]