aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 655dd7ff4..e44bd9b93 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -181,7 +181,7 @@ static int my_stat(struct dnode *cur)
#ifdef BB_FEATURE_LS_FOLLOWLINKS
if (follow_links == TRUE) {
if (stat(cur->fullname, &cur->dstat)) {
- error_msg("%s: %s\n", cur->fullname, strerror(errno));
+ perror_msg("%s", cur->fullname);
status = EXIT_FAILURE;
free(cur->fullname);
free(cur);
@@ -190,7 +190,7 @@ static int my_stat(struct dnode *cur)
} else
#endif
if (lstat(cur->fullname, &cur->dstat)) {
- error_msg("%s: %s\n", cur->fullname, strerror(errno));
+ perror_msg("%s", cur->fullname);
status = EXIT_FAILURE;
free(cur->fullname);
free(cur);
@@ -511,7 +511,7 @@ struct dnode **list_dir(char *path)
nfiles= 0;
dir = opendir(path);
if (dir == NULL) {
- error_msg("%s: %s\n", path, strerror(errno));
+ perror_msg("%s", path);
status = EXIT_FAILURE;
return(NULL); /* could not open the dir */
}