Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 11:05:48 -0500
From:      "Brian F. Feldman" <green@FreeBSD.org>
To:        nate@yogotech.com (Nate Williams)
Cc:        Mark Murray <markm@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/rwall rwall.c 
Message-ID:  <200203071605.g27G5m083023@green.bikeshed.org>
In-Reply-To: Your message of "Thu, 07 Mar 2002 08:55:50 MST." <15495.36230.517729.174507@caddis.yogotech.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams <nate@yogotech.com> wrote:
> > -       if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+")))
> > +       fd = mkstemp(tmpname);
> > +       fp = fdopen(fd, "r+");
> > +       if (fd == -1 || !fp)
> > 
> > Why did you need to do such code restructuring?
> 
> It also changes the logic of the code, since the fdopen wouldn't get
> called if the mkstemp command failed.

Only flaw I see with it is it will cause the mkstemp(3)'s errno to be 
clobbered with EBADF.


-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green@FreeBSD.org  <> bfeldman@tislabs.com      \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203071605.g27G5m083023>