From f25519d6887fc9285d3e0ff1cd259a5e74d5a80a Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 28 Jan 2013 14:56:44 +0100 Subject: df: do not treat rootfs specially Like any other pseudo file system, df should show rootfs only when the -a option is specified, i.e. specifying -trootfs alone is not sufficient. As the rootfs entry is now elided by the general deduplication in filter_mount_list (commit v8.20-103-gbb116d3), all other references to rootfs can be removed again. * src/df.c (show_rootfs): Remove global variable. (ROOTFS): Remove constant. (filter_mount_list): Remove case to handle rootfs specially. (main): In the case for handling the -t option, remove setting of the show_rootfs variable. * tests/df/skip-rootfs.sh: Adapt the test case "df -t rootfs": the rootfs file system must not be printed (because no -a). * doc/coreutils.texi (df invocation): Correct the documentation about eliding mount entries: it is not the first occurrence of the the device which wins, but now rather the entry with the shortest mount point name. Also adapt the description about eliding pseudo file system types like rootfs. * NEWS (Changes in behavior): Adapt entry. --- tests/df/skip-rootfs.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/df/skip-rootfs.sh b/tests/df/skip-rootfs.sh index 7b9632bbb..9c5d0a9f2 100755 --- a/tests/df/skip-rootfs.sh +++ b/tests/df/skip-rootfs.sh @@ -29,12 +29,14 @@ grep '^rootfs' out || skip_ "no rootfs in mtab" df >out || fail=1 grep '^rootfs' out && { fail=1; cat out; } -# Ensure that the rootfs is shown when explicitly specifying "-t rootfs". -df -t rootfs >out || fail=1 -grep '^rootfs' out || { fail=1; cat out; } +# Ensure that rootfs is yet skipped when explicitly specifying "-t rootfs". +# As df emits "no file systems processed" in this case, it would be a failure +# if df exited with status Zero. +df -t rootfs >out && fail=1 +grep '^rootfs' out && { fail=1; cat out; } -# Ensure that the rootfs is shown when explicitly specifying "-t rootfs", -# even when the -a option is specified. +# Ensure that the rootfs is shown when explicitly both specifying "-t rootfs" +# and the -a option. df -t rootfs -a >out || fail=1 grep '^rootfs' out || { fail=1; cat out; } -- cgit v1.2.3-54-g00ecf