Ralph wrote:
Strictly speaking, I wonder if it should be attempting to open(2)
each contender with O_CREAT | O_EXCL until one succeeds, at which
point it has the file descriptor to use. Unlikely to be an issue
with interactive use but perhaps with some procmail-type handling?
Good point. There isn't a clean way to pass the fd with
the existing code. Do you see any problems with this:
if ((fd == open (file, O_CREAT | O_EXCL), mode) >= 0) {
close (fd);
break;
}
and later . . .
fopen (file, "w") . . .
David
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers