From owner-svn-src-head@FreeBSD.ORG Sun Nov 14 23:07:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89B3A106564A; Sun, 14 Nov 2010 23:07:02 +0000 (UTC) (envelope-from gavin@ury.york.ac.uk) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 97FA58FC08; Sun, 14 Nov 2010 23:07:00 +0000 (UTC) Received: from mail-gw14.york.ac.uk ([144.32.129.164]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 820039482 for ed@FreeBSD.org;2bfdefeaec0891c3; Sun, 14 Nov 2010 23:07:00 +0000 Received: from ury.york.ac.uk ([144.32.108.81]:55922) by mail-gw14.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PHlf1-0007UD-DC; Sun, 14 Nov 2010 23:06:59 +0000 Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PHlf1-00049q-4r; Sun, 14 Nov 2010 23:06:59 +0000 Date: Sun, 14 Nov 2010 23:06:59 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Ed Schouten In-Reply-To: <201011141842.oAEIgdqL090361@svn.freebsd.org> Message-ID: References: <201011141842.oAEIgdqL090361@svn.freebsd.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215310 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2010 23:07:02 -0000 On Sun, 14 Nov 2010, Ed Schouten wrote: > Author: ed > Date: Sun Nov 14 18:42:39 2010 > New Revision: 215310 > URL: http://svn.freebsd.org/changeset/base/215310 > > Log: > Always set errno to a sane value when pututxline(3) fails. > > For example, it will now return ESRCH when trying to replace a > nonexistent entry with DEAD_PROCESS. > > Modified: > head/lib/libc/gen/pututxline.c > > Modified: head/lib/libc/gen/pututxline.c > ============================================================================== > --- head/lib/libc/gen/pututxline.c Sun Nov 14 18:24:12 2010 (r215309) > +++ head/lib/libc/gen/pututxline.c Sun Nov 14 18:42:39 2010 (r215310) > @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -53,6 +54,7 @@ futx_open(const char *file) > /* Safety check: never use broken files. */ > if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) { > _close(fd); > + errno = EINVAL; > return (NULL); > } setutxdb(3) returns EFTYPE here, for the same error. Should this be the same? > > @@ -142,6 +144,7 @@ utx_active_remove(struct futx *fu) > } > > fclose(fp); > + errno = ESRCH; > return (1); > } These possible errors should probably also now be documented in pututxline(3). Gavin