-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 10/21/2009 9:33 PM: >> + * lib/at-func.c (FUNC_FAIL): New define. >> + (AT_FUNC_NAME, VALIDATE_FLAG): Use it rather than raw -1. > > Oops - I missed one instance relating to FUNC_FAIL. test-areadlinkat was > failing on older Linux, because /proc/self/fd/-1/name gave ENOENT rather > than EBADF. But since 0 <= char* was always true, the fallback code that > converts ENOENT into the correct error was never triggered. > areadlinkat-with-size was the only other impacted client of at-func.c.
And yet one more instance, this time caught by gcc warnings, but harder to trigger in code. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrmbH0ACgkQ84KuGfSFAYDpWQCgrWMK8ir72haggTGduiJGqC72 d9gAn2RURQebGVmyTCQW4j+HgypDwVrD =uVhI -----END PGP SIGNATURE-----
>From 185233aa304e916609398bc9539029c01805b4d6 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Mon, 26 Oct 2009 21:41:21 -0600 Subject: [PATCH] areadlinkat: fix fallback path * lib/at-func.c (AT_FUNC_NAME): Avoid signed comparison between pointer and zero. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 6 ++++++ lib/at-func.c | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2f8551..0897109 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Eric Blake <e...@byu.net> + + areadlinkat: fix fallback path + * lib/at-func.c (AT_FUNC_NAME): Avoid signed comparison between + pointer and zero. + 2009-10-22 Pádraig Brady <p...@draigbrady.com> Use a better IO block size for modern systems diff --git a/lib/at-func.c b/lib/at-func.c index cc7bfc2..73be401 100644 --- a/lib/at-func.c +++ b/lib/at-func.c @@ -115,7 +115,7 @@ AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS) } err = CALL_FUNC (file); - saved_errno = (err < 0 ? errno : 0); + saved_errno = (err == FUNC_FAIL ? errno : 0); if (restore_cwd (&saved_cwd) != 0) openat_restore_fail (errno); -- 1.6.5.rc1