summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorErik Andersen2000-03-22 07:12:05 +0000
committerErik Andersen2000-03-22 07:12:05 +0000
commitec5bd90916b6e815a36c14ac04d1b78e3e487400 (patch)
tree3602e12b02fe289306dccfb27fba31fda53db690 /coreutils
parent016ffe93077975b01e84493d7cc303f78f70441a (diff)
downloadbusybox-ec5bd90916b6e815a36c14ac04d1b78e3e487400.zip
busybox-ec5bd90916b6e815a36c14ac04d1b78e3e487400.tar.gz
Use the nice new find_real_root_device function to find the
name of the root device, instead of having libc read whatever lies happen to be in /etc/mtab. -Erik
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/df.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/coreutils/df.c b/coreutils/df.c
index bc843f7..331ef2d 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -27,7 +27,6 @@
#include <mntent.h>
#include <sys/stat.h>
#include <sys/vfs.h>
-#include <fstab.h>
static const char df_usage[] = "df [filesystem ...]\n"
@@ -40,7 +39,6 @@ static int df(char *device, const char *mountPoint)
struct statfs s;
long blocks_used;
long blocks_percent_used;
- struct fstab *fstabItem;
if (statfs(mountPoint, &s) != 0) {
perror(mountPoint);
@@ -53,9 +51,9 @@ static int df(char *device, const char *mountPoint)
(blocks_used * 100.0 / (blocks_used + s.f_bavail) + 0.5);
/* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */
if (strcmp(device, "/dev/root") == 0) {
- fstabItem = getfsfile("/");
- if (fstabItem != NULL)
- device = fstabItem->fs_spec;
+ /* Adjusts device to be the real root device,
+ * or leaves device alone if it can't find it */
+ find_real_root_device_name( device);
}
printf("%-20s %9ld %9ld %9ld %3ld%% %s\n",
device,