diff options
author | Eric Andersen | 1999-10-07 08:30:23 +0000 |
---|---|---|
committer | Eric Andersen | 1999-10-07 08:30:23 +0000 |
commit | 596e5469d00fa4a74d8a3b1ebfaae20ce8dc3afe (patch) | |
tree | 4d48d109e66c5197bb27c8215062aab28d385509 /df.c | |
parent | 5c3199e0a519695c367b773e179b5458670f452b (diff) | |
download | busybox-596e5469d00fa4a74d8a3b1ebfaae20ce8dc3afe.zip busybox-596e5469d00fa4a74d8a3b1ebfaae20ce8dc3afe.tar.gz |
more stuff
Diffstat (limited to 'df.c')
-rw-r--r-- | df.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -3,6 +3,7 @@ #include <mntent.h> #include <sys/stat.h> #include <sys/vfs.h> +#include <fstab.h> const char df_usage[] = "df [filesystem ...]\n" "\n" @@ -10,7 +11,7 @@ const char df_usage[] = "df [filesystem ...]\n" static int -df(const char * device, const char * mountPoint) +df(char* device, const char * mountPoint) { struct statfs s; long blocks_used; @@ -25,6 +26,8 @@ df(const char * device, const char * mountPoint) blocks_used = s.f_blocks - s.f_bfree; blocks_percent_used = (long) (blocks_used * 100.0 / (blocks_used + s.f_bavail) + 0.5); + if ( strcmp(device, "/dev/root")==0) + device=(getfsfile ("/"))->fs_spec; printf( "%-20s %9ld %9ld %9ld %3ld%% %s\n", @@ -75,7 +78,7 @@ df_main(int argc, char * * argv) } while ( (mountEntry = getmntent (mountTable))) { - int status=df(mountEntry->mnt_fsname ,mountEntry->mnt_dir); + int status=df(mountEntry->mnt_fsname, mountEntry->mnt_dir); if (status) return status; } @@ -129,3 +132,5 @@ findMountPoint(const char* name, const char* table) endmntent(mountTable); return mountEntry; } + + |