From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 15:59:35 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 93C7E106564A; Thu, 1 Sep 2011 15:59:35 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4A98FC18; Thu, 1 Sep 2011 15:59:34 +0000 (UTC) Received: by yxn22 with SMTP id 22so603867yxn.13 for ; Thu, 01 Sep 2011 08:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EMVgJs36hNOaqwB4xD/bWyCOLht6ESJJs2g4jRO934c=; b=vqGXDaGuH5xsT3OpnwwjDavAQdHOV3s1JEfPWplXlsjKET7/F8oYN5W05Gog9Bweqg ucyH7mi6TGGbSZcw4MTCvN3G2vf2Y7oTzaLJ3vR1kNlYA/6KRk+zMe43tnJmusLvlrRM ysohA8AtKgnBPz5jXgNULNLmrYtG+T15S2yGo= MIME-Version: 1.0 Received: by 10.150.114.16 with SMTP id m16mr170789ybc.399.1314891126407; Thu, 01 Sep 2011 08:32:06 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.150.53.2 with HTTP; Thu, 1 Sep 2011 08:32:06 -0700 (PDT) In-Reply-To: <20110824211427.GB96070@stack.nl> References: <201108222354.p7MNsC9B074753@svn.freebsd.org> <20110824211427.GB96070@stack.nl> Date: Thu, 1 Sep 2011 19:32:06 +0400 X-Google-Sender-Auth: d3ZyY84lHDYpWY9OLxlu_K7mCjc Message-ID: From: Sergey Kandaurov To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, gk@freebsd.org, src-committers@freebsd.org, Matthew D Fleming 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: Thu, 01 Sep 2011 15:59:35 -0000 On 25 August 2011 01:14, Jilles Tjoelker wrote: > 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: >> =A0 Avoid using dirfd name there is dirfd() macro already. >> =A0 Use dirfd() instead of dirp->dd_fd. >> =A0 Replace dirfd() macro with exported libc symbol. >> =A0 Use _dirfd() macro internally. > >> =A0 GSoC r222835, r222836, r222837. >> =A0 Code by Gleb Kurtsou. > >> Added: projects/ino64/lib/libc/gen/dirfd.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- /dev/null 00:00:00 1970 =A0 (empty, because file is newly added) >> +++ projects/ino64/lib/libc/gen/dirfd.c =A0 =A0 =A0 Mon Aug 22 23:54:12 = 2011 =A0 =A0 =A0 =A0(r225097) > [snip] >> +int >> +dirfd(DIR *dirp) >> +{ >> + =A0 =A0 if (dirp =3D=3D NULL) >> + =A0 =A0 =A0 =A0 =A0 =A0 return (-1); >> + >> + =A0 =A0 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. > Why not to convert it to EINVAL? As per IEEE Std 1003.1-2008: The dirfd() function may fail if: [EINVAL] The dirp argument does not refer to a valid directory stream. P.S. It seems autoconf expects dirfd() to be a function and fails if that's a macro (found when trying to build openssh-portable) --=20 wbr, pluknet