Oops. Forgot the usleep.c file.
[oweals/busybox.git] / df.c
diff --git a/df.c b/df.c
index 43d5d26e7220b951b960639bb939dca28a0945b3..331ef2d49d65a6d073fa69cd9e99bb85117e6abf 100644 (file)
--- a/df.c
+++ b/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,
@@ -108,3 +106,11 @@ extern int df_main(int argc, char **argv)
 
        exit(TRUE);
 }
+
+/*
+Local Variables:
+c-file-style: "linux"
+c-basic-offset: 4
+tab-width: 4
+End:
+*/