Re: [PATCH] HAVE_MKSTEMP tries to kill not existent tmp-file in $HOME and $TMPDIR (1.9.2)

Urs Janßen <[email protected]>
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Thu, May 24, 2007 at 06:25:06PM +0200, Rado S wrote:
> Moin,
> 
> after revisiting this issue, I offer this attached patch:
> even though this 5s delay for each successful posting is very
> annoying, the debug output is totally useless, when you read "man
> mkstemp", because it says:
> ------ QUOTE BEGIN ------
> The function thus prevents any possible race condition between
> testing whether the file exists and opening it for use.
> ------- QUOTE END -------

sounds like a solaris thing as neither the linux nor the freebsd or the
opengroup manpages mention this (currently I have no solaris box)

> Therefore by defintion there any ENOENT case is just a side-effect:
> the idea of this function is to not have the tmp-file exist.

returning ENOENT in case of "No such file" is stupid in this case and if the
dir doesnt exist it should return ENOTDIR. the current code is:

	fd = mkstemp(filename);
#   ifdef DEBUG
	sverrno = errno;
	if (fd == -1 && sverrno)
		wait_message(5, "HAVE_MKSTEMP %s: %s", filename, strerror(sverrno))
#   endif /* DEBUG */

which should suffice. no special case for ENOENT (as this sounds like a
broken implementation) and no user notify when n ot running in debug mode
(as this is not a grave error.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.