From owner-cvs-all Thu Mar 7 8: 5:53 2002 Delivered-To: cvs-all@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8844437B400; Thu, 7 Mar 2002 08:05:49 -0800 (PST) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g27G5m083023; Thu, 7 Mar 2002 11:05:48 -0500 (EST) (envelope-from green@green.bikeshed.org) Message-Id: <200203071605.g27G5m083023@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: nate@yogotech.com (Nate Williams) Cc: Mark Murray , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/rwall rwall.c In-Reply-To: Your message of "Thu, 07 Mar 2002 08:55:50 MST." <15495.36230.517729.174507@caddis.yogotech.com> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Mar 2002 11:05:48 -0500 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nate Williams 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