aboutsummaryrefslogtreecommitdiff
path: root/coreutils/df.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-19 03:56:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-19 03:56:20 +0000
commit0354aba9a14e3c28934af505688acbb62437d95e (patch)
tree9ca3b7a142812718a43ad06a5ac2183bbabc077f /coreutils/df.c
parent7f88e34e1a19fca5eb29f5cfb57c54f1ecd5c4a9 (diff)
downloadbusybox-w32-0354aba9a14e3c28934af505688acbb62437d95e.tar.gz
busybox-w32-0354aba9a14e3c28934af505688acbb62437d95e.tar.bz2
busybox-w32-0354aba9a14e3c28934af505688acbb62437d95e.zip
df: fix FEATURE_DF_FANCY=off, FEATURE_HUMAN_READABLE=on case.
Diffstat (limited to 'coreutils/df.c')
-rw-r--r--coreutils/df.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/coreutils/df.c b/coreutils/df.c
index 1c7d6cb38..dfd6e0b41 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -44,8 +44,7 @@ int df_main(int argc, char **argv)
44 FILE *mount_table; 44 FILE *mount_table;
45 struct mntent *mount_entry; 45 struct mntent *mount_entry;
46 struct statfs s; 46 struct statfs s;
47 static const char ignored_mounts[] ALIGN1 = 47 static const char ignored_mounts[] ALIGN1 = "rootfs\0";
48 "rootfs\0";
49 48
50 enum { 49 enum {
51 OPT_KILO = (1 << 0), 50 OPT_KILO = (1 << 0),
@@ -53,8 +52,8 @@ int df_main(int argc, char **argv)
53 OPT_ALL = (1 << 2) * ENABLE_FEATURE_DF_FANCY, 52 OPT_ALL = (1 << 2) * ENABLE_FEATURE_DF_FANCY,
54 OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY, 53 OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
55 OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY, 54 OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
56 OPT_HUMAN = (1 << 5) * ENABLE_FEATURE_HUMAN_READABLE, 55 OPT_HUMAN = (1 << (2 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
57 OPT_MEGA = (1 << 6) * ENABLE_FEATURE_HUMAN_READABLE, 56 OPT_MEGA = (1 << (3 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
58 }; 57 };
59 const char *disp_units_hdr = NULL; 58 const char *disp_units_hdr = NULL;
60 char *chp; 59 char *chp;
@@ -124,7 +123,7 @@ int df_main(int argc, char **argv)
124 mount_entry = find_mount_point(mount_point, bb_path_mtab_file); 123 mount_entry = find_mount_point(mount_point, bb_path_mtab_file);
125 if (!mount_entry) { 124 if (!mount_entry) {
126 bb_error_msg("%s: can't find mount point", mount_point); 125 bb_error_msg("%s: can't find mount point", mount_point);
127 SET_ERROR: 126 set_error:
128 status = EXIT_FAILURE; 127 status = EXIT_FAILURE;
129 continue; 128 continue;
130 } 129 }
@@ -135,7 +134,7 @@ int df_main(int argc, char **argv)
135 134
136 if (statfs(mount_point, &s) != 0) { 135 if (statfs(mount_point, &s) != 0) {
137 bb_simple_perror_msg(mount_point); 136 bb_simple_perror_msg(mount_point);
138 goto SET_ERROR; 137 goto set_error;
139 } 138 }
140 139
141 if ((s.f_blocks > 0) || !mount_table || (opt & OPT_ALL)) { 140 if ((s.f_blocks > 0) || !mount_table || (opt & OPT_ALL)) {
@@ -166,7 +165,7 @@ int df_main(int argc, char **argv)
166 * or leaves device alone if it can't find it */ 165 * or leaves device alone if it can't find it */
167 device = find_block_device("/"); 166 device = find_block_device("/");
168 if (!device) { 167 if (!device) {
169 goto SET_ERROR; 168 goto set_error;
170 } 169 }
171 } 170 }
172#endif 171#endif