From 7565800a1155104559b5c02b73afc2e3b2aeda07 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 15 May 1999 01:53:21 +0000 Subject: [PATCH] (main): When asking for info on an explicit file name, just warn rather than failing if the table of mounted filesystems cannot be read. --- src/df.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/df.c b/src/df.c index 41b2b647a2..c505bb3bf3 100644 --- a/src/df.c +++ b/src/df.c @@ -753,7 +753,15 @@ main (int argc, char **argv) || show_local_fs)); if (mount_list == NULL) - error (1, errno, _("cannot read table of mounted filesystems")); + { + /* Couldn't read the table of mounted filesystems. + Fail if df was invoked with no file name arguments; + Otherwise, merely give a warning and proceed. */ + const char *warning = (optind == argc ? "" : _("Warning: ")); + int status = (optind == argc ? 1 : 0); + error (status, errno, + _("%scannot read table of mounted filesystems"), warning); + } if (require_sync) sync (); -- 2.47.3