aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/Kbuild.src20
-rw-r--r--coreutils/df.c20
-rw-r--r--coreutils/install.c3
-rw-r--r--coreutils/test.c2
4 files changed, 34 insertions, 11 deletions
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src
index 8e2c097a3..d9a448781 100644
--- a/coreutils/Kbuild.src
+++ b/coreutils/Kbuild.src
@@ -10,12 +10,16 @@ lib-y:=
10 10
11INSERT 11INSERT
12 12
13lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty 13lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
14lib-$(CONFIG_LESS) += cat.o # less too 14lib-$(CONFIG_LESS) += cat.o # less too
15lib-$(CONFIG_CRONTAB) += cat.o # crontab -l 15lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
16lib-$(CONFIG_ADDUSER) += chown.o # used by adduser 16lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
17lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser 17lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
18lib-$(CONFIG_ASH) += echo.o # used by ash 18lib-$(CONFIG_ASH) += echo.o # used by ash
19lib-$(CONFIG_HUSH) += echo.o # used by hush 19lib-$(CONFIG_SH_IS_ASH) += echo.o # used by ash
20lib-$(CONFIG_FTPD) += ls.o # used by ftpd 20lib-$(CONFIG_BASH_IS_ASH) += echo.o # used by ash
21lib-$(CONFIG_HUSH) += echo.o # used by hush
22lib-$(CONFIG_SH_IS_HUSH) += echo.o # used by hush
23lib-$(CONFIG_BASH_IS_HUSH) += echo.o # used by hush
24lib-$(CONFIG_FTPD) += ls.o # used by ftpd
21lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o 25lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o
diff --git a/coreutils/df.c b/coreutils/df.c
index fdcdae675..79e4c4670 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -129,8 +129,19 @@ int df_main(int argc UNUSED_PARAM, char **argv)
129 if (opt & OPT_MEGA) 129 if (opt & OPT_MEGA)
130 df_disp_hr = 1024*1024; 130 df_disp_hr = 1024*1024;
131 131
132 if (opt & OPT_BSIZE) 132 if (opt & OPT_BSIZE) {
133 df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */ 133 /* GNU coreutils 8.25 accepts "-BMiB" form too */
134 int i;
135 for (i = 0; kmg_i_suffixes[i].suffix[0]; i++) {
136 if (strcmp(kmg_i_suffixes[i].suffix, chp) == 0) {
137 df_disp_hr = kmg_i_suffixes[i].mult;
138 goto got_it;
139 }
140 }
141 /* Range used to disallow 0 */
142 df_disp_hr = xatoul_range_sfx(chp, 1, ULONG_MAX, kmg_i_suffixes);
143 got_it: ;
144 }
134 145
135 /* From the manpage of df from coreutils-6.10: 146 /* From the manpage of df from coreutils-6.10:
136 * Disk space is shown in 1K blocks by default, unless the environment 147 * Disk space is shown in 1K blocks by default, unless the environment
@@ -203,6 +214,11 @@ int df_main(int argc UNUSED_PARAM, char **argv)
203 bb_simple_perror_msg(mount_point); 214 bb_simple_perror_msg(mount_point);
204 goto set_error; 215 goto set_error;
205 } 216 }
217 /* Some uclibc versions were seen to lose f_frsize
218 * (kernel does return it, but then uclibc does not copy it)
219 */
220 if (s.f_frsize == 0)
221 s.f_frsize = s.f_bsize;
206 222
207 if ((s.f_blocks > 0) || !mount_table || (opt & OPT_ALL)) { 223 if ((s.f_blocks > 0) || !mount_table || (opt & OPT_ALL)) {
208 if (opt & OPT_INODE) { 224 if (opt & OPT_INODE) {
diff --git a/coreutils/install.c b/coreutils/install.c
index e68589229..831f9b802 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -211,7 +211,8 @@ int install_main(int argc, char **argv)
211 char *ddir = xstrdup(dest); 211 char *ddir = xstrdup(dest);
212 bb_make_directory(dirname(ddir), 0755, mkdir_flags); 212 bb_make_directory(dirname(ddir), 0755, mkdir_flags);
213 /* errors are not checked. copy_file 213 /* errors are not checked. copy_file
214 * will fail if dir is not created. */ 214 * will fail if dir is not created.
215 */
215 free(ddir); 216 free(ddir);
216 } 217 }
217 if (isdir) 218 if (isdir)
diff --git a/coreutils/test.c b/coreutils/test.c
index df42590e4..67fdfde4f 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -55,6 +55,8 @@
55//kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o 55//kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o
56//kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o 56//kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o
57//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o 57//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o
58//kbuild:lib-$(CONFIG_SH_IS_HUSH) += test.o test_ptr_hack.o
59//kbuild:lib-$(CONFIG_BASH_IS_HUSH) += test.o test_ptr_hack.o
58 60
59/* "test --help" is special-cased to ignore --help */ 61/* "test --help" is special-cased to ignore --help */
60//usage:#define test_trivial_usage NOUSAGE_STR 62//usage:#define test_trivial_usage NOUSAGE_STR