summaryrefslogtreecommitdiff
path: root/elf/sln.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/sln.c')
-rw-r--r--elf/sln.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/elf/sln.c b/elf/sln.c
index 9d57be2df5..3d3b7e0525 100644
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -1,5 +1,5 @@
/* `sln' program to create symbolic links between files.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,10 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
#include <error.h>
#include <errno.h>
#include <libintl.h>
@@ -37,10 +33,6 @@
#define PACKAGE _libc_intl_domainname
-#if !defined S_ISDIR && defined S_IFDIR
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-
static int makesymlink (const char *src, const char *dest);
static int makesymlinks (const char *file);
static void usage (void);
@@ -89,9 +81,6 @@ usage (void)
static int
makesymlinks (const char *file)
{
-#ifndef PATH_MAX
-#define PATH_MAX 4095
-#endif
char *buffer = NULL;
size_t bufferlen = 0;
int ret;
@@ -164,11 +153,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))
{
@@ -190,11 +179,7 @@ makesymlink (const char *src, const char *dest)
return -1;
}
-#ifdef S_ISLNK
if (symlink (src, dest) == 0)
-#else
- if (link (src, dest) == 0)
-#endif
{
/* Destination must exist by now. */
if (access (dest, F_OK))