Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 03:18:05 -0800
From:      "David O'Brien" <obrien@FreeBSD.org>
To:        Mike Barcroft <mike@FreeBSD.org>
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:  <20020307031805.A63863@dragon.nuxi.com>
In-Reply-To: <20020307060920.C81803@espresso.q9media.com>; from mike@FreeBSD.org on Thu, Mar 07, 2002 at 06:09:20AM -0500
References:  <200203042027.g24KRc978637@freefall.freebsd.org> <20020307030244.B63484@dragon.nuxi.com> <20020307060920.C81803@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 07, 2002 at 06:09:20AM -0500, Mike Barcroft 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?
> 
> This introduces a bug where fdopen() could attempt to open a bad file
> descriptor in the case of an error with mkstemp().

Exactly.  I would like all of these type of changes backed out until they
can be reviewed.  It is too easy to not realize the author's dependence
on short-circuiting.
 
-- 
-- David  (obrien@FreeBSD.org)

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?20020307031805.A63863>