wok-stable diff busybox/stuff/busybox-1.7.3-df.u @ rev 1912
Add glibc-extra-samba (2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 21 23:17:46 2008 +0000 (2008-12-21) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.7.3-df.u Sun Dec 21 23:17:46 2008 +0000 1.3 @@ -0,0 +1,42 @@ 1.4 +--- busybox-1.7.3/coreutils/df.c 1.5 ++++ busybox-1.7.3/coreutils/df.c 1.6 +@@ -47,7 +47,7 @@ 1.7 + 1.8 + #if ENABLE_FEATURE_HUMAN_READABLE 1.9 + opt_complementary = "h-km:k-hm:m-hk"; 1.10 +- opt = getopt32(argv, "hmk"); 1.11 ++ opt = getopt32(argv, "hmik"); 1.12 + if (opt & 1) { 1.13 + df_disp_hr = 0; 1.14 + disp_units_hdr = " Size"; 1.15 +@@ -56,9 +56,14 @@ 1.16 + df_disp_hr = 1024*1024; 1.17 + disp_units_hdr = "1M-blocks"; 1.18 + } 1.19 ++#define OPT_INODE 4 1.20 + #else 1.21 ++#define OPT_INODE 1 1.22 + opt = getopt32(argv, "k"); 1.23 + #endif 1.24 ++ if (opt & OPT_INODE) { 1.25 ++ disp_units_hdr = " Inodes"; 1.26 ++ } 1.27 + 1.28 + printf("Filesystem%11s%-15sUsed Available Use%% Mounted on\n", 1.29 + "", disp_units_hdr); 1.30 +@@ -105,6 +110,15 @@ 1.31 + } 1.32 + 1.33 + if ((s.f_blocks > 0) || !mount_table){ 1.34 ++ if (opt & OPT_INODE) { 1.35 ++ s.f_blocks = s.f_files; 1.36 ++ s.f_bavail = s.f_bfree = s.f_ffree; 1.37 ++ s.f_bsize = 1; 1.38 ++#if ENABLE_FEATURE_HUMAN_READABLE 1.39 ++ if (df_disp_hr) 1.40 ++ df_disp_hr = 1; 1.41 ++#endif 1.42 ++ } 1.43 + blocks_used = s.f_blocks - s.f_bfree; 1.44 + blocks_percent_used = 0; 1.45 + if (blocks_used + s.f_bavail) {