From patchwork Mon Mar 7 01:21:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 11226 Received: (qmail 16267 invoked by alias); 7 Mar 2016 01:30:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16245 invoked by uid 89); 7 Mar 2016 01:30:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=262 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] sln: use stat64 Date: Sun, 6 Mar 2016 20:21:10 -0500 Message-Id: <1457313670-22660-1-git-send-email-vapier@gentoo.org> From: Hongjiu Zhang 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. 2016-03-06 Hongjiu Zhang * elf/sln.c (makesymlink): Change stat to stat64, and lstat to lstat64. --- elf/sln.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/sln.c b/elf/sln.c index 9d57be2..f52cb9f 100644 --- 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)) {