[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Changes to allow nmh 1.3 to work on VFAT (or other non
Re: [Nmh-workers] Changes to allow nmh 1.3 to work on VFAT (or other non-linking FS)
Tue, 08 Jul 2008 13:53:45 +0100
Peter Maydell wrote:
>The first change is fine, but the second (to lock_file.c) needs thinking
>about. If it's OK to just creat() the curlock then we ought to be doing
>it in all cases, not creating it as something else and link()ing it.
>On the other hand, if just-creat() isn't right then you shouldn't be
>doing it just because the link() failed EPERM.
It might be OK if you do an open(O_CREAT|O_EXCL) instead of a creat().
We can't do this as the default because O_EXCL doesn't work over NFS.
But if link() fails EPERM we can assume not-NFS and trust that O_EXCL
works on VFAT. (Probably worth testing that.)
I think the code as you have it does no locking at all, so you're
potentially going to lose mail if several programs try to do something