summaryrefslogtreecommitdiff
path: root/src/df.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/df.c')
-rw-r--r--src/df.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/df.c b/src/df.c
index 5dc3d2dd0..4f3b56b25 100644
--- a/src/df.c
+++ b/src/df.c
@@ -515,7 +515,8 @@ get_dev (char const *disk, char const *mount_point,
if (! file_systems_processed)
{
- file_systems_processed = true;
+ if (! force_fsu)
+ file_systems_processed = true;
get_header ();
}
@@ -1124,7 +1125,7 @@ main (int argc, char **argv)
else
get_all_entries ();
- if (print_grand_total)
+ if (print_grand_total && file_systems_processed)
{
if (inode_format)
grand_fsu.fsu_blocks = 1;
@@ -1133,7 +1134,9 @@ main (int argc, char **argv)
print_table ();
- if (! file_systems_processed)
+ /* Print the "no FS processed" diagnostic only if there was no preceding
+ diagnostic, e.g., if all have been excluded. */
+ if (exit_status == EXIT_SUCCESS && ! file_systems_processed)
error (EXIT_FAILURE, 0, _("no file systems processed"));
exit (exit_status);