From: Jim Meyering Date: Sat, 15 May 1999 01:53:21 +0000 (+0000) Subject: (main): When asking for info on an explicit file name, X-Git-Tag: TEXTUTILS-1_22l~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7565800a1155104559b5c02b73afc2e3b2aeda07;p=thirdparty%2Fcoreutils.git (main): When asking for info on an explicit file name, just warn rather than failing if the table of mounted filesystems cannot be read. --- 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 ();