]> 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:45:21 +0000 (11:45 -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)
(cherry picked from commit d6778fc4b0039b2116f88218212618ca357fee2f)

ChangeLog
elf/sln.c

index 95cc5a2a02314d4daa068965e6655f53dd42f512..7663053f02a1b8ce560965d89b74df45505d9b34 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.
+
 2015-08-05  Mike Frysinger  <vapier@gentoo.org>
 
        * nptl/allocatestack.c (allocate_stack): Move stacktop decl down to
index 1a7d24e6dc1418d03b220ef181c91931e80102cc..c6601fdbfc5ed2c1f62563b974dfba28b5474787 100644 (file)
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -167,11 +167,11 @@ makesymlink (src, dest)
      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))
        {