]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sln: use stat64
authorHongjiu Zhang <noctuorare@gmail.com>
Mon, 7 Mar 2016 01:18:21 +0000 (20:18 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 7 Mar 2016 16:39:06 +0000 (11:39 -0500)
When using sln on some filesystems which return 64-bit inodes,
the stat call might fail during install like so:
.../elf/sln .../elf/symlink.list
/lib32/libc.so.6: invalid destination: Value too large for defined data type
/lib32/ld-linux.so.2: invalid destination: Value too large for defined data type
Makefile:104: recipe for target 'install-symbolic-link' failed

Switch to using stat64 all the time to avoid this.

URL: https://bugs.gentoo.org/576396
(cherry picked from commit f5e753c8c3a18a1e3c715dd11bf4dc341b5c481f)

ChangeLog
elf/sln.c

index 12346b315156b2c8f394528a5e9c1e85640ae7e1..4a27eb795211f925bd1c5b461f8ee21b06d43012 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-07  Hongjiu Zhang  <noctuorare@gmail.com>
+
+       * elf/sln.c (makesymlink): Change struct stat to stat64, and lstat
+       to lstat64.
+
 2016-02-24  Marko Myllynen  <myllynen@redhat.com>
 
        * NEWS (2.23): Fix typo in bug 19048 text.
index 9d57be2df56af3bd0c24729065ba255887c574f8..f52cb9f44a85bbeb83933b1b497db85232ef85c8 100644 (file)
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -164,11 +164,11 @@ makesymlinks (const char *file)
 static int
 makesymlink (const char *src, const char *dest)
 {
-  struct stat stats;
+  struct stat64 stats;
   const char *error;
 
   /* Destination must not be a directory. */
-  if (lstat (dest, &stats) == 0)
+  if (lstat64 (dest, &stats) == 0)
     {
       if (S_ISDIR (stats.st_mode))
        {