diff options
author | Bernhard Voelker <mail@bernhard-voelker.de> | 2013-01-28 14:56:44 +0100 |
---|---|---|
committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2013-01-28 14:56:44 +0100 |
commit | f25519d6887fc9285d3e0ff1cd259a5e74d5a80a (patch) | |
tree | 4d7dd5cee10158c8d2e314d650a5926e23effa01 /src | |
parent | bb116d35bf6248d803826fb582a141d02a311e71 (diff) | |
download | coreutils-f25519d6887fc9285d3e0ff1cd259a5e74d5a80a.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/df.c | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -63,12 +63,6 @@ static bool show_local_fs; command line argument -- even if it's a dummy (automounter) entry. */ static bool show_listed_fs; -/* If true, include rootfs in the output. */ -static bool show_rootfs; - -/* The literal name of the initial root file system. */ -static char const *ROOTFS = "rootfs"; - /* Human-readable options for output. */ static int human_output_opts; @@ -608,8 +602,7 @@ excluded_fstype (const char *fstype) In the case of duplicities - based on to the device number - the mount entry with a '/' in its me_devname (i.e. not pseudo name like tmpfs) wins. If both have a real devname (e.g. bind mounts), then that with the shorter - me_mountdir wins. - Finally, do not filter out a rootfs entry if -trootfs is specified. */ + me_mountdir wins. */ static void filter_mount_list (void) @@ -630,16 +623,6 @@ filter_mount_list (void) ; /* Stat failed - add ME to be able to complain about it later. */ } else - if (show_rootfs - && ( STREQ (me->me_mountdir, "/") - || STREQ (me->me_type, ROOTFS))) - { - /* Df should show rootfs (due to -trootfs). - Add this ME both if it is the rootfs entry itself or "/" - (as that must not replace the rootfs entry in the devlist). */ - ; - } - else { /* If the device name is a real path name ... */ if (strchr (me->me_devname, '/')) @@ -1383,7 +1366,6 @@ main (int argc, char **argv) /* Accept -F as a synonym for -t for compatibility with Solaris. */ case 't': add_fs_type (optarg); - show_rootfs = selected_fstype (ROOTFS); break; case 'v': /* For SysV compatibility. */ |