Change calls to error_msg.* and strerror to use perror_msg.*.
diff --git a/ls.c b/ls.c
index 655dd7f..e44bd9b 100644
--- a/ls.c
+++ b/ls.c
@@ -181,7 +181,7 @@
#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 @@
} 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 @@
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 */
}