Age | Commit message (Collapse) | Author |
|
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().
This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.
Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.
This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.
The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):
Arm: -92 bytes
MIPS: -52 bytes
PPC: -1836 bytes
x86_64: -938 bytes
Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.
Signed-off-by: James Byrne <james.byrne@origamienergy.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
cp_main 428 512 +84
copy_file 1676 1742 +66
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
bb_ask_y_confirmation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
unsafe_symlink_target - 147 +147
unzip_main 2711 2732 +21
copy_file 1657 1678 +21
tar_main 999 971 -28
data_extract_all 1038 984 -54
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/2 up/down: 189/-82) Total: 107 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Based on the patch by wdlkmpx@gmail.com
function old new delta
copy_file 1546 1644 +98
add_partition 1270 1362 +92
ask_and_unlink 95 133 +38
do_iproute 132 157 +25
decode_one_format 710 715 +5
cp_main 369 374 +5
ubirename_main 198 202 +4
read_package_field 232 230 -2
bb_make_directory 421 412 -9
packed_usage 30505 30476 -29
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/3 up/down: 267/-40) Total: 227 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
With FEATURE_VERBOSE off, practically no size change.
With it on:
function old new delta
remove_file 493 556 +63
install_main 719 765 +46
bb_make_directory 383 419 +36
rmdir_main 162 191 +29
copy_file 1516 1544 +28
mv_main 502 525 +23
cmp_main 677 693 +16
bbconfig_config_bz2 5264 5279 +15
mkdir_main 158 168 +10
install_longopts 66 76 +10
rm_main 167 175 +8
nexpr 840 846 +6
scan_tree 275 280 +5
fsck_main 1807 1811 +4
ed_main 2541 2545 +4
expand_one_var 1574 1575 +1
swap_on_off_main 420 418 -2
parse_command 1443 1440 -3
redirect 1279 1274 -5
do_load 946 918 -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 16/4 up/down: 304/-38) Total: 266 bytes
Based on the patch by Igor Živković.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
copy_file 1495 1518 +23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
text data bss dec hex filename
808035 611 6868 815514 c719a busybox_old
804472 611 6868 811951 c63af busybox_unstripped
|
|
(almost because we do not copy mode, which is probably wasn't intended).
+61 bytes.
|
|
|
|
write to dest which is a symlink.
|
|
function old new delta
copy_file 1487 1538 +51
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 51/0) Total: 51 bytes
text data bss dec hex filename
772502 1051 10724 784277 bf795 busybox_old
772554 1051 10724 784329 bf7c9 busybox_unstripped
|
|
|
|
|
|
function old new delta
copy_file 1565 1447 -118
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-118) Total: -118 bytes
text data bss dec hex filename
770938 1063 10788 782789 bf1c5 busybox_old
770814 1063 10788 782665 bf149 busybox_unstripped
|
|
|
|
rename link_name to link_target, less confusing this way.
|
|
|
|
cat: stop using stdio.h opens
libbb: introduce & use open[3]_or_warn
function old new delta
open3_or_warn - 54 +54
bb_cat 115 144 +29
open_or_warn - 25 +25
unlzma 2404 2412 +8
chattr_main 334 339 +5
xstrtoul_range_sfx 251 255 +4
telnet_main 1514 1510 -4
static.opt 4 - -4
qgravechar 122 118 -4
fuser_add_pid 61 54 -7
fuser_add_inode 154 147 -7
writeFileToTarball 1542 1534 -8
refresh 1156 1148 -8
do_show 856 846 -10
read_leases 212 200 -12
setup_redirects 236 222 -14
iproute_list_or_flush 1582 1568 -14
read_config 427 411 -16
write_leases 284 264 -20
hash_file 338 318 -20
copy_file 1760 1740 -20
do_iproute 2610 2588 -22
bb_full_fd_action 320 269 -51
open_to_or_warn 103 49 -54
fuser_main 1660 1596 -64
.rodata 131160 131096 -64
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423) Total: -298 bytes
|
|
|
|
Add comment explaining POSIX rules for cp - and why
these rules are dangerous. Provide conditionally compiled code
for both POSIX and safe behaviors, select safe for now.
Code shrunk by ~80 bytes.
|
|
|
|
(patch by Yuichi Nakamura <ynakam@hitachisoft.jp>)
runcon: *yet another* fix for vda's brainfart :(
|
|
|
|
libbb: rename xgetcwd and xreadlink
|
|
|
|
Add doc on POSIX's rules on -i and -f (insane!).
ln: make "ln dangling_symlink new_link" work.
|
|
|
|
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
|
|
trigger for symlinks, not for device nodes. This should fix "cp -a /dev ."
to work as expected (when run by root, anyway).
While I was there, cleanup headers and make an #ifdef go away...
|
|
|
|
text data bss dec hex filename
889445 9392 1035784 1934621 1d851d busybox.gcc-4.2.orig
889297 9392 1035784 1934473 1d8489 busybox.gcc-4.2
889009 9820 1037860 1936689 1d8d31 busybox.gcc-4.1.orig
888817 9820 1037860 1936497 1d8c71 busybox.gcc-4.1
|
|
- include the correct headers: applets need busybox.h while lib* need libbb.h
|
|
|
|
|
|
|
|
0000117: Remove linefeed after overwrite prompt using cp -i
User input not on the same line as the prompt when about to
overwrite a file.
|
|
0000067: cp -p produces misleading error message
|