summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-07-30 16:34:17 +0000
committerJim Meyering <jim@meyering.net>1994-07-30 16:34:17 +0000
commit32bd426778e4d37e233fe06ce66eb72b4a84c883 (patch)
tree81eae5822f0dba853b9116c074fb3a2a55ba8faa /src/ls.c
parenta272d8b0c6e62937ef7b69e3ca750e34fd3e3152 (diff)
downloadcoreutils-32bd426778e4d37e233fe06ce66eb72b4a84c883.tar.xz
.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ls.c b/src/ls.c
index 06b9dae79..da0c1d66e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -60,6 +60,8 @@
#include "ls.h"
#include "version.h"
+#include "safe-stat.h"
+#include "safe-lstat.h"
#ifndef S_IEXEC
#define S_IEXEC S_IXUSR
@@ -992,14 +994,14 @@ gobble_file (name, explicit_arg, dirname)
if (trace_links)
{
- val = stat (path, &files[files_index].stat);
+ val = SAFE_STAT (path, &files[files_index].stat);
if (val < 0)
/* Perhaps a symbolically-linked to file doesn't exist; stat
the link instead. */
- val = lstat (path, &files[files_index].stat);
+ val = SAFE_LSTAT (path, &files[files_index].stat);
}
else
- val = lstat (path, &files[files_index].stat);
+ val = SAFE_LSTAT (path, &files[files_index].stat);
if (val < 0)
{
error (0, errno, "%s", path);
@@ -1022,7 +1024,7 @@ gobble_file (name, explicit_arg, dirname)
if (linkpath
&& ((explicit_arg && format != long_format)
|| indicator_style != none)
- && stat (linkpath, &linkstats) == 0)
+ && SAFE_STAT (linkpath, &linkstats) == 0)
{
/* Symbolic links to directories that are mentioned on the
command line are automatically traced if not being