aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-02-16 10:44:14 -0600
committerRob Landley <rob@landley.net>2021-02-16 10:44:55 -0600
commitb26587fb956c4145d67518ea295cd058ef21c4f9 (patch)
treef0d399ccb8bc5107bfff18ca209141bbe37ccc94 /toys/posix
parent4d3bf8b61e2158856572ca927cd831b9461a03a4 (diff)
downloadtoybox-b26587fb956c4145d67518ea295cd058ef21c4f9.tar.gz
Only error once for each "df nonexistent"
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/df.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/posix/df.c b/toys/posix/df.c
index 7f43a109..0201315e 100644
--- a/toys/posix/df.c
+++ b/toys/posix/df.c
@@ -155,8 +155,9 @@ void df_main(void)
struct stat st;
// Stat it (complain if we can't).
- if (stat(*next, &st)) perror_msg("'%s'", *next);
- else {
+ if (stat(*next, &st)) {
+ if (!measuring) perror_msg("'%s'", *next);
+ } else {
// Find and display this filesystem. Use _last_ hit in case of
// overmounts (which is first hit in the reversed list).
for (mt = mtend; mt; mt = mt->prev)