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

Rado S <[email protected]> Fri, 25 May 2007 15:43:05 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
=- Urs Janßen wrote on Thu 24.May'07 at 20:14:33 +0200 -=

> > ------ 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)

Oh ... true, it's solaris... hmm...

> 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:

The problem is not that the dir doesn't exist (since it's $HOME, it
exists ;), but that the tmp-file to be used must not exist before.

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

The functionality hasn't changed, why have you put the extra sverrno
var there?

> 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.

Oh... "not grave": what happens/ fails, when the tmp-file fails?
AFAICS the Date: and MSG-ID: headers won't be added.
Anything else maybe? Isn't a MSG-ID a good thing to have?

-- 
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.
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.