From b26587fb956c4145d67518ea295cd058ef21c4f9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 16 Feb 2021 10:44:14 -0600 Subject: Only error once for each "df nonexistent" --- toys/posix/df.c | 5 +++-- 1 file 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) -- cgit v1.2.3