diff options
author | Jim Meyering <jim@meyering.net> | 1999-05-15 01:53:21 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-05-15 01:53:21 +0000 |
commit | 7565800a1155104559b5c02b73afc2e3b2aeda07 (patch) | |
tree | 207b13c2ecb805d2e6cec2ff3c63f7fa53f7b142 /src | |
parent | 2d97b1c61b80132b0c6acd6d2d3130b6d74a94d2 (diff) | |
download | coreutils-7565800a1155104559b5c02b73afc2e3b2aeda07.tar.xz |
(main): When asking for info on an explicit file name,
just warn rather than failing if the table of mounted filesystems
cannot be read.
Diffstat (limited to 'src')
-rw-r--r-- | src/df.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 (); |