[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] nmh should be more careful about when it unlinks draft

From: Ken Hornstein
Subject: Re: [Nmh-workers] nmh should be more careful about when it unlinks draft files
Date: Tue, 03 Jan 2017 10:50:11 -0500

>> - The file is created with creat(), which as you know does get called
>> with O_CREAT, but does not include O_EXCL.
>Could that be considered a bug?  That's comp(1).  I UTSL this time and
>repl(1) appears to fopen(..., "w") so it's no better off.

Sigh.  Maybe?  Like I said, there are plenty of places where it is assumed
that only one nmh program is running simultaneously (things like rcvstore
are one of the exceptions, but really, people who used that had their
sequence files corrupted every so often and we've only gotten the locking
sored out relatively recently, and THAT was a complicated mess).

At least in the case of comp(1), by the time creat() is called it is
writing a new draft into that file.  It seems like the assumption at
that point is that no one else is writing to that file.  So I am thinking
that using O_CREAT | O_EXCL is fine. What do others think?  It looks
like we could do something similar in replsbr.c:replout().


reply via email to

[Prev in Thread] Current Thread [Next in Thread]