From: epg <> Date: Thu, 16 Jan 2003 17:59:18 +0000 (+0000) Subject: (deliver): Stick closer to the standard maildir delivery algorithm by X-Git-Url: https://diplodocus.org/git/mdeliver/commitdiff_plain/cbab192ba54fdeb51f62f514cc6e5eeba9b4e98f?hp=cbab192ba54fdeb51f62f514cc6e5eeba9b4e98f (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. ---