bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] coreutils-6.0 memcoll fix


From: Eric Blake
Subject: Re: [PATCH] coreutils-6.0 memcoll fix
Date: Wed, 16 Aug 2006 06:35:44 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Pádraig Brady on 8/16/2006 2:50 AM:
> +++ memcoll-errno.c     2006-08-16 06:50:28.000000000 +0000
> @@ -43,7 +43,10 @@
>       the buffers using strcoll on each substring.  */
> 
>    if (s1len == s2len && memcmp (s1, s2, s1len) == 0)
> -    diff = 0;
> +    {
> +      diff = 0;
> +      errno = 0;
> +    }

This seems a bit fishy to me.  In the strcoll counterpart, POSIX states
that strcoll must not set errno to 0, and that the value of errno is
unchanged on success (an app desiring to check for failure must set errno
to 0 itself before calling strcoll).  For consistency, would it be better
if we changed memcoll to behave likewise?  On the other hand, I guess we
did document in memcoll.c that memcoll explicitly sets errno to 0 on
success, making memcoll not quite like strcoll.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE4xEf84KuGfSFAYARAlqEAKC3doVpxB3NdH9+1Mxx2MbmfQuKQQCffD3N
BGviajhQdVbKg1CjKhsK8fg=
=jAsQ
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]