summaryrefslogtreecommitdiff
path: root/src/df.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-05-15 01:53:21 +0000
committerJim Meyering <jim@meyering.net>1999-05-15 01:53:21 +0000
commit7565800a1155104559b5c02b73afc2e3b2aeda07 (patch)
tree207b13c2ecb805d2e6cec2ff3c63f7fa53f7b142 /src/df.c
parent2d97b1c61b80132b0c6acd6d2d3130b6d74a94d2 (diff)
downloadcoreutils-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/df.c')
-rw-r--r--src/df.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/df.c b/src/df.c
index 41b2b647a..c505bb3bf 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 ();