Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Nov 2010 15:15:27 -0800
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Gavin Atkinson <gavin@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten <ed@freebsd.org>
Subject:   Re: svn commit: r215310 - head/lib/libc/gen
Message-ID:  <AANLkTinj1q4MC9rf5x6g9Gqwq9gOAkcK%2Bi3_XV%2B6rnLF@mail.gmail.com>
In-Reply-To: <alpine.LNX.2.00.1011142303300.23661@ury.york.ac.uk>
References:  <201011141842.oAEIgdqL090361@svn.freebsd.org> <alpine.LNX.2.00.1011142303300.23661@ury.york.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
--0016364c7576c09e0404950b7fbf
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sun, Nov 14, 2010 at 3:06 PM, Gavin Atkinson <gavin@freebsd.org> wrote:
> 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:
>> =A0 Always set errno to a sane value when pututxline(3) fails.
>>
>> =A0 For example, it will now return ESRCH when trying to replace a
>> =A0 nonexistent entry with DEAD_PROCESS.
>>
>> Modified:
>> =A0 head/lib/libc/gen/pututxline.c
>>
>> Modified: head/lib/libc/gen/pututxline.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
>> --- head/lib/libc/gen/pututxline.c =A0 =A0Sun Nov 14 18:24:12 2010 =A0 =
=A0 =A0 =A0(r215309)
>> +++ head/lib/libc/gen/pututxline.c =A0 =A0Sun Nov 14 18:42:39 2010 =A0 =
=A0 =A0 =A0(r215310)
>> @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
>> =A0#include <sys/endian.h>
>> =A0#include <sys/stat.h>
>> =A0#include <sys/uio.h>
>> +#include <errno.h>
>> =A0#include <fcntl.h>
>> =A0#include <stdio.h>
>> =A0#include <string.h>
>> @@ -53,6 +54,7 @@ futx_open(const char *file)
>> =A0 =A0 =A0 /* Safety check: never use broken files. */
>> =A0 =A0 =A0 if (_fstat(fd, &sb) !=3D -1 && sb.st_size % sizeof(struct fu=
tx) !=3D 0) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 _close(fd);
>> + =A0 =A0 =A0 =A0 =A0 =A0 errno =3D EINVAL;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (NULL);
>> =A0 =A0 =A0 }
>
> setutxdb(3) returns EFTYPE here, for the same error. =A0Should this be th=
e
> same?
>
>>
>> @@ -142,6 +144,7 @@ utx_active_remove(struct futx *fu)
>> =A0 =A0 =A0 }
>>
>> =A0 =A0 =A0 fclose(fp);
>> + =A0 =A0 errno =3D ESRCH;
>> =A0 =A0 =A0 return (1);
>> =A0}
>
> These possible errors should probably also now be documented in
> pututxline(3).

    I submitted another patch earlier to Ed that does this and a bit
more (attached). He was going to take a look at the patch and get back
to me (and I CCed Bruce Evans for additional comments), but please
feel free to chime in :).
Thanks,
-Garrett

--0016364c7576c09e0404950b7fbf
Content-Type: text/x-patch; charset=US-ASCII; name="utx-changes-2.patch"
Content-Disposition: attachment; filename="utx-changes-2.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ggijlnzh0

SW5kZXg6IGxpYi9saWJjL2dlbi9nZXR1dHhlbnQuMwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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Ql1dCA9IGNhbGxvYygxLCBzaXplb2YgKnV0KTsKIAkJaWYgKHV0ID09
IE5VTEwpCiAJCQlyZXR1cm4gKE5VTEwpOwotCX0gZWxzZSB7CisJfSBlbHNlCiAJCW1lbXNldCh1
dCwgMCwgc2l6ZW9mICp1dCk7Ci0JfQogCiAJc3dpdGNoIChmdS0+ZnVfdHlwZSkgewogCWNhc2Ug
Qk9PVF9USU1FOgo=
--0016364c7576c09e0404950b7fbf--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinj1q4MC9rf5x6g9Gqwq9gOAkcK%2Bi3_XV%2B6rnLF>