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>
+2009-10-21 Eric Blake <ebb9@byu.net>
+
+ areadlinkat: avoid failure on older glibc
+ * lib/at-func.c (AT_FUNC_NAME): Check for explicit FUNC_FAIL,
+ rather than mis-comparing 0 against FUNC_RESULT of char*.
+
2009-10-21 Bruno Haible <bruno@clisp.org>
* modules/stpncpy (License): Relicense under LGPLv2+.
/* 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))
{