]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Use __fstatat64 in fchmodat implementation
authorFlorian Weimer <fweimer@redhat.com>
Thu, 5 Mar 2020 12:27:53 +0000 (13:27 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 5 Mar 2020 15:10:26 +0000 (16:10 +0100)
fstatat64 depends on inlining to produce the desired __fxstatat64
call, which does not happen with -Os, leading to a link failure
with an undefined reference to fstatat64.  __fxstatat64 has a macro
definition in include/sys/stat.h and thus avoids the problem.

sysdeps/unix/sysv/linux/fchmodat.c

index 17eca54051ee28ba1ec3f9aed170a62630959143..5531f1aa6f982e25e1578d461457a3514144fdb8 100644 (file)
@@ -48,7 +48,7 @@ fchmodat (int fd, const char *file, mode_t mode, int flag)
       /* Use fstatat because fstat does not work on O_PATH descriptors
         before Linux 3.6.  */
       struct stat64 st;
-      if (fstatat64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
+      if (__fstatat64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
        {
          __close_nocancel (pathfd);
          return -1;