summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-21 21:01:41 -0600
committerEric Blake <ebb9@byu.net>2009-10-21 21:31:52 -0600
commit447ce7436647899cfe03ee154bb2b2789d3a8eac (patch)
treef18ea42e22a9232e120ddaaf39307a00e6965724 /lib
parent4bb09526539ef33e14c130d2b22e6d49dfdfe3b0 (diff)
downloadgnulib-447ce7436647899cfe03ee154bb2b2789d3a8eac.tar.gz
areadlinkat: avoid failure on older glibc
Acting on /proc/self/-1/name gives ENOTDIR. at-func normally falls back to fchdir, which discovers the real problem of invalid fd and changes to EBADF; but for areadlinkat, it mistakenly short-circuited when FUNC_FAIL was NULL (since 0<=(char*)result is always true). * lib/at-func.c (AT_FUNC_NAME): Check for explicit FUNC_FAIL, rather than mis-comparing 0 against FUNC_RESULT of char*. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/at-func.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/at-func.c b/lib/at-func.c
index b6aa0fd550..cc7bfc2de1 100644
--- a/lib/at-func.c
+++ b/lib/at-func.c
@@ -84,7 +84,7 @@ AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
/* If the syscall succeeds, or if it fails with an unexpected
errno value, then return right away. Otherwise, fall through
and resort to using save_cwd/restore_cwd. */
- if (0 <= proc_result)
+ if (FUNC_FAIL != proc_result)
return proc_result;
if (! EXPECTED_ERRNO (proc_errno))
{