From owner-svn-src-projects@FreeBSD.ORG Wed Aug 24 21:14:29 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7BA106566B; Wed, 24 Aug 2011 21:14:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 08FC38FC08; Wed, 24 Aug 2011 21:14:29 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 0AB231DD781; Wed, 24 Aug 2011 23:14:28 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 028CC173CB; Wed, 24 Aug 2011 23:14:27 +0200 (CEST) Date: Wed, 24 Aug 2011 23:14:27 +0200 From: Jilles Tjoelker To: gk@freebsd.org Message-ID: <20110824211427.GB96070@stack.nl> References: <201108222354.p7MNsC9B074753@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201108222354.p7MNsC9B074753@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-projects@freebsd.org, Matthew D Fleming , src-committers@freebsd.org Subject: Re: svn commit: r225097 - in projects/ino64: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2011 21:14:29 -0000 On Mon, Aug 22, 2011 at 11:54:12PM +0000, Matthew D Fleming wrote: > Author: mdf > Date: Mon Aug 22 23:54:12 2011 > New Revision: 225097 > URL: http://svn.freebsd.org/changeset/base/225097 > Log: > Avoid using dirfd name there is dirfd() macro already. > Use dirfd() instead of dirp->dd_fd. > Replace dirfd() macro with exported libc symbol. > Use _dirfd() macro internally. > GSoC r222835, r222836, r222837. > Code by Gleb Kurtsou. > Added: projects/ino64/lib/libc/gen/dirfd.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ projects/ino64/lib/libc/gen/dirfd.c Mon Aug 22 23:54:12 2011 (r225097) [snip] > +int > +dirfd(DIR *dirp) > +{ > + if (dirp == NULL) > + return (-1); > + > + return (_dirfd(dirp)); > +} Why have this check here? I think the original behaviour (a segfault) is more useful here since the return value of this interface is often not checked. -- Jilles Tjoelker