2 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] flock() on device files
FromSent OnAttachments
David LayApr 20, 2005 10:17 pm 
Devin RubiaApr 21, 2005 6:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] flock() on device filesActions...
From:Devin Rubia (dev@thezone.net)
Date:Apr 21, 2005 6:31:45 am
List:net.sourceforge.lists.courier-maildrop

On Thu, Apr 21, 2005 at 03:17:37PM +1000, David Lay wrote:

I've noticed an problem involving flock() on device files [/dev/null in particular] under FreeBSD. There is a comment in the source code which implies awareness of this issue but it looks to me like there is a logic error in the code:

[SNIP]

My first question is why you are doing something that needs locking of /dev/null in the first place? As far as I can see, maildrop will only attempt to lock /dev/null if you are trying to deliver to it. eg.:

to "/dev/null"

However, that is a waste, requiring CPU time and memory bandwidth to move the entire message into the bit bucket. You could instead use:

EXITCODE=0 exit

and have the exact same result without the unnecessary file locking.