From 34a0ea765870866608d9d62cde4dd950a2340c0a Mon Sep 17 00:00:00 2001 From: andersen Date: Thu, 7 Oct 1999 08:30:23 +0000 Subject: more stuff git-svn-id: svn://busybox.net/trunk/busybox@15 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- df.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'df.c') diff --git a/df.c b/df.c index 354b2a7ca..8cc93814b 100644 --- a/df.c +++ b/df.c @@ -3,6 +3,7 @@ #include #include #include +#include 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; } + + -- cgit v1.2.3-55-g6feb