aboutsummaryrefslogtreecommitdiff
path: root/coreutils/df.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-09-17 11:36:53 +0100
committerRon Yorston <rmy@pobox.com>2021-09-17 11:38:52 +0100
commit46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52 (patch)
tree6194cdabc0858ae3bed0276679b3b80a722f4150 /coreutils/df.c
parentcf91de46997888b7096352805c05401e7ebae01e (diff)
parent9fe1548bbfde548d54acaab113656a56ea0ccc72 (diff)
downloadbusybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.tar.gz
busybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.tar.bz2
busybox-w32-46299d0c4f4c9a4bbad38bbbe26f196e1bccdc52.zip
Merge branch 'busybox' into merge
Disable FEATURE_TIMEZONE for now.
Diffstat (limited to 'coreutils/df.c')
-rw-r--r--coreutils/df.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/coreutils/df.c b/coreutils/df.c
index e8d4bc8f2..9f8b3a71e 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -99,15 +99,16 @@ int df_main(int argc UNUSED_PARAM, char **argv)
99 struct mntent *mount_entry; 99 struct mntent *mount_entry;
100 struct statvfs s; 100 struct statvfs s;
101 enum { 101 enum {
102 OPT_KILO = (1 << 0), 102 OPT_KILO = (1 << 0),
103 OPT_POSIX = (1 << 1), 103 OPT_POSIX = (1 << 1),
104 OPT_FSTYPE = (1 << 2), 104 OPT_FSTYPE = (1 << 2),
105 OPT_t = (1 << 3), 105 OPT_t = (1 << 3),
106 OPT_ALL = (1 << 4) * ENABLE_FEATURE_DF_FANCY, 106 OPT_ALL = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
107 OPT_INODE = (1 << 5) * ENABLE_FEATURE_DF_FANCY, 107 OPT_INODE = (1 << 5) * ENABLE_FEATURE_DF_FANCY,
108 OPT_BSIZE = (1 << 6) * ENABLE_FEATURE_DF_FANCY, 108 OPT_BSIZE = (1 << 6) * ENABLE_FEATURE_DF_FANCY,
109 OPT_HUMAN = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, 109 OPT_HUMAN = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
110 OPT_MEGA = (1 << (5 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, 110 OPT_HUMANDEC = (1 << (5 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
111 OPT_MEGA = (1 << (6 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
111 }; 112 };
112 const char *disp_units_hdr = NULL; 113 const char *disp_units_hdr = NULL;
113 char *chp, *opt_t; 114 char *chp, *opt_t;
@@ -124,7 +125,7 @@ int df_main(int argc UNUSED_PARAM, char **argv)
124 opt = getopt32(argv, "^" 125 opt = getopt32(argv, "^"
125 "kPTt:" 126 "kPTt:"
126 IF_FEATURE_DF_FANCY("aiB:") 127 IF_FEATURE_DF_FANCY("aiB:")
127 IF_FEATURE_HUMAN_READABLE("hm") 128 IF_FEATURE_HUMAN_READABLE("hHm")
128 "\0" 129 "\0"
129#if ENABLE_FEATURE_HUMAN_READABLE && ENABLE_FEATURE_DF_FANCY 130#if ENABLE_FEATURE_HUMAN_READABLE && ENABLE_FEATURE_DF_FANCY
130 "k-mB:m-Bk:B-km" 131 "k-mB:m-Bk:B-km"
@@ -151,8 +152,11 @@ int df_main(int argc UNUSED_PARAM, char **argv)
151 got_it: ; 152 got_it: ;
152 } 153 }
153 154
154 if (opt & OPT_HUMAN) { 155 if (opt & (OPT_HUMAN|OPT_HUMANDEC)) {
155 df_disp_hr = 0; 156 df_disp_hr = 0;
157//TODO: need to add support in make_human_readable_str() for "decimal human readable"
158 //if (opt & OPT_HUMANDEC)
159 // df_disp_hr--;
156 disp_units_hdr = " Size"; 160 disp_units_hdr = " Size";
157 } 161 }
158 if (opt & OPT_INODE) 162 if (opt & OPT_INODE)