]> diplodocus.org Git - mdeliver/commit
(deliver): Stick closer to the standard maildir delivery algorithm by
authorepg <>
Thu, 16 Jan 2003 17:59:18 +0000 (17:59 +0000)
committerepg <>
Thu, 16 Jan 2003 17:59:18 +0000 (17:59 +0000)
commitcbab192ba54fdeb51f62f514cc6e5eeba9b4e98f
treedf66c4706cab81b96fff7a34b220d605bf4bb452
parentda0eb4486d061f80f27a2df57da2a78d6244736d
(deliver): Stick closer to the standard maildir delivery algorithm by
using link(2) + unlink(2) instead of rename(2) to get the message file
from tmp to new.  rename(2) will clobber an existing file, which we
don't want; link(2) will not.

Strictly speaking this is an impossible scenario for mdeliver, for
which one process delivers no more than one message.  It is, however,
not outside the realm of possibility that a filename identical to the
one chosen by mdeliver came into existence for some unrelated reason
(though the odds of this happening must be staggering).

Perhaps more importantly, it has been reported on the qmail list that
OpenBSD 3.2 will reuse the same PID in the same second, which would
mean this was a real problem on that system.

Whatever the case, this addresses any potential problems.
mdeliver.c