* lib/faccessat.c (rpl_faccessat): Do the trailing-slash workaround also
if the original faccessat invocation failed.
+2024-09-16 Bruno Haible <bruno@clisp.org>
+
+ faccessat: Correct errno value on AIX.
+ * lib/faccessat.c (rpl_faccessat): Do the trailing-slash workaround also
+ if the original faccessat invocation failed.
+
2024-09-10 Bruno Haible <bruno@clisp.org>
mbrtoc16: Fix undefined behaviour.
{
int result = orig_faccessat (fd, file, mode, flag);
- if (result == 0 && file[strlen (file) - 1] == '/')
+ if (file[strlen (file) - 1] == '/')
{
struct stat st;
- result = fstatat (fd, file, &st, 0);
- if (result == 0 && !S_ISDIR (st.st_mode))
+ int ret = fstatat (fd, file, &st, 0);
+ if (ret == 0 && !S_ISDIR (st.st_mode))
{
errno = ENOTDIR;
return -1;
}
+ if (result == 0)
+ result = ret;
}
return result;