diff options
author | Jim Meyering <jim@meyering.net> | 1994-07-30 16:34:17 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1994-07-30 16:34:17 +0000 |
commit | 32bd426778e4d37e233fe06ce66eb72b4a84c883 (patch) | |
tree | 81eae5822f0dba853b9116c074fb3a2a55ba8faa /src/ln.c | |
parent | a272d8b0c6e62937ef7b69e3ca750e34fd3e3152 (diff) | |
download | coreutils-32bd426778e4d37e233fe06ce66eb72b4a84c883.tar.xz |
.
Diffstat (limited to 'src/ln.c')
-rw-r--r-- | src/ln.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -38,6 +38,7 @@ #include "system.h" #include "backupfile.h" #include "version.h" +#include "safe-lstat.h" int link (); /* Some systems don't declare this anywhere. */ @@ -223,7 +224,7 @@ main (argc, argv) `ln source dest/' to `ln source dest/basename(source)'. */ if (dest[strlen (dest) - 1] == '/' - && lstat (source, &source_stats) == 0 + && SAFE_LSTAT (source, &source_stats) == 0 && !S_ISDIR (source_stats.st_mode)) { PATH_BASENAME_CONCAT (new_dest, dest, source); @@ -278,7 +279,7 @@ do_link (source, dest) dest = new_dest; } - if (lstat (dest, &dest_stats) == 0) + if (SAFE_LSTAT (dest, &dest_stats) == 0) { if (S_ISDIR (dest_stats.st_mode)) { |