diff options
Diffstat (limited to 'df.c')
-rw-r--r-- | df.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -27,7 +27,6 @@ | |||
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <sys/stat.h> | 28 | #include <sys/stat.h> |
29 | #include <sys/vfs.h> | 29 | #include <sys/vfs.h> |
30 | #include <fstab.h> | ||
31 | 30 | ||
32 | static const char df_usage[] = "df [filesystem ...]\n" | 31 | static const char df_usage[] = "df [filesystem ...]\n" |
33 | 32 | ||
@@ -40,7 +39,6 @@ static int df(char *device, const char *mountPoint) | |||
40 | struct statfs s; | 39 | struct statfs s; |
41 | long blocks_used; | 40 | long blocks_used; |
42 | long blocks_percent_used; | 41 | long blocks_percent_used; |
43 | struct fstab *fstabItem; | ||
44 | 42 | ||
45 | if (statfs(mountPoint, &s) != 0) { | 43 | if (statfs(mountPoint, &s) != 0) { |
46 | perror(mountPoint); | 44 | perror(mountPoint); |
@@ -53,9 +51,9 @@ static int df(char *device, const char *mountPoint) | |||
53 | (blocks_used * 100.0 / (blocks_used + s.f_bavail) + 0.5); | 51 | (blocks_used * 100.0 / (blocks_used + s.f_bavail) + 0.5); |
54 | /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */ | 52 | /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */ |
55 | if (strcmp(device, "/dev/root") == 0) { | 53 | if (strcmp(device, "/dev/root") == 0) { |
56 | fstabItem = getfsfile("/"); | 54 | /* Adjusts device to be the real root device, |
57 | if (fstabItem != NULL) | 55 | * or leaves device alone if it can't find it */ |
58 | device = fstabItem->fs_spec; | 56 | find_real_root_device_name( device); |
59 | } | 57 | } |
60 | printf("%-20s %9ld %9ld %9ld %3ld%% %s\n", | 58 | printf("%-20s %9ld %9ld %9ld %3ld%% %s\n", |
61 | device, | 59 | device, |