summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2023-11-08start-stop-daemon: do not lose error messages with -bDenys Vlasenko
function old new delta start_stop_daemon_main 1186 1206 +20 bb_daemonize_or_rexec 196 212 +16 bb_banner 47 46 -1 packed_usage 34656 34645 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 36/-12) Total: 24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-10-02sleep: fix "sleep -- ARGS"Denys Vlasenko
function old new delta sleep_main 116 119 +3 printf_main 860 837 -23 single_argv 50 25 -25 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 3/-48) Total: -45 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-17introduce and use exitcode_tDenys Vlasenko
function old new delta strings_main 422 420 -2 setfattr_main 175 173 -2 brctl_main 1548 1546 -2 makedevs_main 979 975 -4 rev_main 337 332 -5 getfattr_main 307 302 -5 cut_main 1201 1196 -5 cksum_main 398 393 -5 umount_main 573 565 -8 ln_main 516 508 -8 expand_main 660 652 -8 df_main 1068 1060 -8 renice_main 346 332 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/13 up/down: 0/-76) Total: -76 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-12hwclock: add get/set parameters optionAndrej Picej
In kernel 5.16 special ioctls were introduced to get/set RTC parameters. Add option to get/set parameters into busybox version of hwclock. Implementation is similar to the one already used in linux-utils hwclock tool. Example of parameter get use: $ hwclock -g 2 The RTC parameter 0x2 is set to 0x2. $ hwclock --param-get bsm The RTC parameter 0x2 is set to 0x2. Example of parameter set use: $ hwclock -p 2=1 The RTC parameter 0x2 will be set to 0x1. $ hwclock -p bsm=2 The RTC parameter 0x2 will be set to 0x2. function old new delta hwclock_main 298 576 +278 .rodata 105231 105400 +169 packed_usage 34541 34576 +35 static.hwclock_longopts 60 84 +24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 506/0) Total: 506 bytes Signed-off-by: Andrej Picej <andrej.picej@norik.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-10ash: disable sleep as builtin, closes 15619Denys Vlasenko
Has a few annoying problems: * sleepcmd() -> sleep_main(), the parsing of bad arguments exits the shell. * sleep_for_duration() in sleep_main() has to be interruptible for ^C traps to work, which may be a problem for other users of sleep_for_duration(). * BUT, if sleep_for_duration() is interruptible, then SIGCHLD interrupts it as well (try "/bin/sleep 1 & sleep 10"). * sleep_main() must not allocate anything as ^C in ash longjmp's. (currently, allocations are only on error paths, in message printing). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-06-15libbb: code shrink: introduce and use [_]exit_FAILURE()Denys Vlasenko
function old new delta exit_FAILURE - 7 +7 _exit_FAILURE - 7 +7 run 198 199 +1 restore_state_and_exit 114 115 +1 xbsd_write_bootstrap 399 397 -2 vfork_compressor 209 207 -2 sig_handler 12 10 -2 serial_ctl 154 152 -2 parse_args 1169 1167 -2 onintr 21 19 -2 make_new_session 493 491 -2 login_main 988 986 -2 gotsig 35 33 -2 do_iplink 1315 1313 -2 addgroup_main 397 395 -2 inetd_main 1911 1908 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-27libbb/dump: make xxd_displayoff member conditional on xxdDenys Vlasenko
With xxd not selected: function old new delta display 1459 1444 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26libbb/dump: conditionalize code used only by xxd and odDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: stop printing extra trailing spacesDenys Vlasenko
function old new delta .rodata 104598 104613 +15 display 1475 1485 +10 od_main 549 556 +7 rewrite 971 967 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 32/-4) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-06libbb: consolidate NOMMU fix of restoring high bit in argv[0][0]Denys Vlasenko
function old new delta fork_or_rexec 46 56 +10 bootchartd_main 1087 1079 -8 cpio_main 674 661 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 10/-21) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03shell: fix compile failures in some configsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-27ash: optional sleep builtinShawn Landden
function old new delta sleepcmd - 10 +10 builtintab 352 360 +8 .rodata 105264 105271 +7 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes Signed-off-by: Shawn Landden <shawnlandden@tutanota.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-06-26ash,hush: use HOME for tab completion and promptsRon Yorston
ash and hush correctly use the value of HOME for tilde expansion. However the line editing code in libbb obtains the user's home directory by calling getpwuid(). Thus tildes in tab completion and prompts may be interpreted differently than in tilde expansion. When the line editing code is invoked from a shell make it use the shell's interpretation of tilde. This is similar to how GNU readline and bash collaborate. function old new delta get_homedir_or_NULL 29 72 +43 optschanged 119 126 +7 hush_main 1204 1211 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 57/0) Total: 57 bytes v2: Always check for HOME before trying the password database: this is what GNU readline does. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-02-06*: slap on a few ALIGN* where appropriateDenys Vlasenko
The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" function old new delta .rodata 108586 108460 -126 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-126) Total: -126 bytes text data bss dec hex filename 970412 4219 1848 976479 ee65f busybox_old 970286 4219 1848 976353 ee5e1 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-23apply const trick to ptr_to_globalsKhem Raj
This was missing in the previous attempt to fix it via [1] This helps fix segfaults when compiling with clang ( seen on riscv64 ) [ 452.428349] less[270]: unhandled signal 11 code 0x1 at 0x000000000000000c in busybox.nosuid[2ab7491000+ba000] [ 452.430246] CPU: 3 PID: 270 Comm: less Not tainted 5.15.13-yocto-standard #1 [ 452.431323] Hardware name: riscv-virtio,qemu (DT) [ 452.431925] epc : 0000002ab74a19ee ra : 0000002ab74a19dc sp : 0000003fec6ec980 [ 452.432725] gp : 0000002ab754dcb0 tp : 0000003f88783800 t0 : 0000003f8878d4a0 [ 452.433744] t1 : 0000002ab749b00c t2 : 0000000000000000 s0 : 0000003fec6ecc38 [ 452.434732] s1 : 000000000000004c a0 : 00000000ffffffff a1 : 0000002ab754dde0 [ 452.435861] a2 : 0000000000000000 a3 : 0000000000000100 a4 : 0000002ab754f3a0 [ 452.436787] a5 : 0000002ab754f3a0 a6 : 0000000000000000 a7 : 0000002ab754f2a0 [ 452.437974] s2 : 0000000000000002 s3 : 0000002ab754b6c8 s4 : 0000002ab749b60e [ 452.438781] s5 : 0000000000000000 s6 : 0000002ab754b6c8 s7 : 0000003f88943060 [ 452.439723] s8 : 0000003f88944050 s9 : 0000002ad8502e88 s10: 0000002ad8502de8 [ 452.440538] s11: 0000000000000014 t3 : 0000003f887fceb6 t4 : 0000003f8893af0c [ 452.441438] t5 : 0000000000000000 t6 : 0000003f88923000 [1] https://git.busybox.net/busybox/commit/?id=1f925038a Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-18libbb: shrink lineedit_read_key()Denys Vlasenko
function old new delta lineedit_read_key 237 231 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-17ash,hush: fix handling of SIGINT while waiting for interactive inputDenys Vlasenko
function old new delta lineedit_read_key 160 237 +77 __pgetc 522 589 +67 fgetc_interactive 244 309 +65 safe_read_key - 39 +39 read_key 588 607 +19 record_pending_signo 23 32 +9 signal_handler 75 81 +6 .rodata 104312 104309 -3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/1 up/down: 282/-3) Total: 279 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-13libbb: introduce and use chdir_or_warn()Denys Vlasenko
function old new delta chdir_or_warn - 37 +37 send_cgi_and_exit 720 711 -9 xchdir 27 15 -12 setup_environment 233 217 -16 fork_job 449 433 -16 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 37/-53) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-13libbb: invert the meaning of SETUP_ENV_NO_CHDIR -> SETUP_ENV_CHDIRDenys Vlasenko
Double negatives are hard to grok. function old new delta login_main 986 988 +2 su_main 474 470 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-4) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-12sulogin: increase util-linux compatibilityDenys Vlasenko
Change to root's HOME. Set some envvars. Steal ctty if necessary and possible. function old new delta sulogin_main 240 340 +100 setup_environment 225 233 +8 su_main 479 474 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 108/-5) Total: 103 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-05libbb: change xstrndup, xmemdup to take size_t as size parameterDenys Vlasenko
Also, remove entirely usually-disabled paranoia check (was also using wrong config option to enable itself). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-05libbb: code shrink: introduce and use [_]exit_SUCCESS()Denys Vlasenko
function old new delta exit_SUCCESS - 7 +7 _exit_SUCCESS - 7 +7 run_pipe 1562 1567 +5 pseudo_exec_argv 399 400 +1 finish 86 87 +1 start_stop_daemon_main 1109 1107 -2 shutdown_on_signal 38 36 -2 runsv_main 1662 1660 -2 redirect 1070 1068 -2 read_line 79 77 -2 pause_and_low_level_reboot 54 52 -2 list_i2c_busses_and_exit 483 481 -2 less_exit 12 10 -2 identify 4123 4121 -2 grep_file 1161 1159 -2 getty_main 1519 1517 -2 fsck_minix_main 2681 2679 -2 free_session 132 130 -2 fdisk_main 4739 4737 -2 clean_up_and_exit 53 51 -2 bsd_select 1566 1564 -2 bb_daemonize_or_rexec 198 196 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-04libbb: factor out fflush_stdout_and_exit(EXIT_SUCCESS)Denys Vlasenko
function old new delta fflush_stdout_and_exit_SUCCESS - 7 +7 xxd_main 890 888 -2 vlock_main 353 351 -2 uuencode_main 318 316 -2 uniq_main 427 425 -2 uname_main 250 248 -2 sort_main 853 851 -2 shuf_main 500 498 -2 route_main 238 236 -2 readlink_main 113 111 -2 nice_main 156 154 -2 last_main 957 955 -2 ipcs_main 960 958 -2 env_main 209 207 -2 chrt_main 464 462 -2 cal_main 921 919 -2 baseNUM_main 650 648 -2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/16 up/down: 7/-32) Total: -25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-11-28libarchive: remove duplicate forward declarationBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2021-11-27tls: P256: 64-bit optimizationsDenys Vlasenko
function old new delta sp_256_proj_point_dbl_8 421 428 +7 sp_256_point_from_bin2x32 78 84 +6 sp_256_cmp_8 38 42 +4 sp_256_to_bin_8 28 31 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 20/0) Total: 20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-12shell: use more compact SHELL_ASH / HUSH config defines. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-11shell: fix script's comm field if ENABLE_FEATURE_PREFER_APPLETS=yDenys Vlasenko
function old new delta re_execed_comm - 46 +46 main 72 86 +14 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 60/0) Total: 60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-09Make const ptr assign as function call in clangYU Jincheng
- This can act as memory barrier in clang to avoid read before assign of a const ptr Signed-off-by: LoveSy <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-09libbb: better coreutils compatibility for realpathRon Yorston
Add some tests which coreutils realpath pass but BusyBox realpath fails (bar one). Adjust xmalloc_realpath_coreutils() so the tests pass: - Expand symbolic links before testing whether the last path component exists. - When the link target is a relative path canonicalize it by passing it through xmalloc_realpath_coreutils() as already happens for absolute paths. - Ignore trailing slashes when finding the last path component and correctly handle the case where the only slash is at the start of the path. This requires ignoring superfluous leading slashes. - Undo all changes to the path so error messages from the caller show the original filename. function old new delta xmalloc_realpath_coreutils 214 313 +99 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-08libbb.h: fix logic selecting incorrect BB_STRTOOFF for !LFS configsDenys Vlasenko
BB_STRTOOFF() was equal to bb_strtou(). On x86_64, it's incorrect. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-07*: generalize "const trick"YU Jincheng
While at it, change all "__asm__" to "asm" Co-authored-by: canyie <31466456+canyie@users.noreply.github.com> Signed-off-by: YU Jincheng <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-17libbb: clarify what bb_mode_string() generatesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-17libbb: eliminate a static data array in bb_mode_string()Denys Vlasenko
function old new delta print_stat 861 869 +8 header_verbose_list_ar 73 77 +4 display_single 975 979 +4 header_verbose_list 237 239 +2 bb_mode_string 124 115 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 18/-9) Total: 9 bytes text data bss dec hex filename 1043136 559 5052 1048747 1000ab busybox_old 1043153 559 5020 1048732 10009c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-17libbb: code shrink bb_parse_modeDenys Vlasenko
function old new delta bb_parse_mode 393 398 +5 static.who_mask 16 8 -8 static.perm_mask 24 12 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 5/-20) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-17date,touch: allow timezone offsets in datesRon Yorston
Allow ISO 8601 style dates to include a timezone offset. Like the '@' format these dates aren't relative to the user's current timezone and shouldn't be subject to DST adjustment. - The implementation uses the strptime() '%z' format specifier. This an extension which may not be available so the use of timezones is a configuration option. - The 'touch' applet has been updated to respect whether DST adjustment is required, matching 'date'. function old new delta parse_datestr 624 730 +106 static.fmt_str 106 136 +30 touch_main 388 392 +4 date_main 818 819 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 141/0) Total: 141 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-09httpd,telnetd: make default port configurableSergey Ponomarev
BusyBox on Termux can't use ports less than 1024 it's patched to change default port for httpd to 8080 and telnetd to 8023. https://github.com/termux/termux-packages/blob/master/packages/busybox/0011-networking-telnetd-default-port.patch https://github.com/termux/termux-packages/blob/master/packages/busybox/0010-networking-httpd-default-port.patch To avoid such patches we can make port configurable. function old new delta packed_usage 33920 33914 -6 Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-08-20tar,smemcap: commonalyze checksumming code for tar headerDenys Vlasenko
function old new delta chksum_and_xwrite_tar_header - 99 +99 writeheader 280 199 -81 chksum_and_xwrite 102 - -102 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 0/1 up/down: 99/-183) Total: -84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-24move iterate_on_dir() from e2fsprogs to libbbDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-22cp: implement -nDenys Vlasenko
function old new delta .rodata 103681 103722 +41 packed_usage 33698 33717 +19 copy_file 1678 1696 +18 cp_main 500 492 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 78/-8) Total: 70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-21cp: implement -t DIRDenys Vlasenko
function old new delta packed_usage 33713 33734 +21 .rodata 103670 103672 +2 cp_main 506 500 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 23/-6) Total: 17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-20lsattr: support more ext2 flagsDenys Vlasenko
function old new delta e2attr_flags_lname 214 285 +71 e2attr_flags_value 52 80 +28 e2attr_flags_sname 14 21 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 106/0) Total: 106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-20lsattr,chattr: support -pDenys Vlasenko
function old new delta fgetsetprojid - 107 +107 list_attributes 169 222 +53 change_attributes 277 326 +49 chattr_main 272 307 +35 close_silently - 22 +22 .rodata 103378 103393 +15 packed_usage 33658 33666 +8 fgetsetversion 88 74 -14 fgetsetflags 162 148 -14 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/2 up/down: 289/-28) Total: 261 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-18free: implement -hDenys Vlasenko
function old new delta .rodata 103331 103363 +32 packed_usage 33652 33654 +2 free_main 657 588 -69 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-69) Total: -35 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-18xxd: implement -i "C style output"Denys Vlasenko
function old new delta xxd_main 710 888 +178 .rodata 103252 103331 +79 print_C_style - 78 +78 packed_usage 33639 33652 +13 next 276 278 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 350/0) Total: 350 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-17xxd: implement -o DISPLAYOFFSETDenys Vlasenko
function old new delta xxd_main 680 710 +30 xstrtoll - 30 +30 bb_dump_dump 1511 1531 +20 rewrite 941 951 +10 packed_usage 33629 33639 +10 .rodata 103250 103252 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/0 up/down: 102/0) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-05ash: add process substitution in bash-compatibility modeRon Yorston
Process substitution is a Korn shell feature that's also available in bash and some other shells. This patch implements process substitution in ash when ASH_BASH_COMPAT is enabled. function old new delta argstr 1386 1522 +136 strtodest - 52 +52 readtoken1 3346 3392 +46 .rodata 183206 183250 +44 unwindredir - 28 +28 cmdloop 365 372 +7 static.spclchars 10 12 +2 cmdputs 380 367 -13 exitreset 86 69 -17 evalcommand 1754 1737 -17 varvalue 675 634 -41 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/4 up/down: 315/-88) Total: 227 bytes text data bss dec hex filename 953967 4219 1904 960090 ea65a busybox_old 954192 4219 1904 960315 ea73b busybox_unstripped v2: Replace array of file descriptors with a linked list. Include tests that were unaccountably omitted from v1. v3: Update linked list code to the intended version. v4: Change order of conditional code in cmdputs(). v5: Use existing popredir() mechanism to manage file descriptors. v6: Rebase to latest version of BusyBox ash. Reduce code churn. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-05runsv: robustify signal handling - SIGTERM to child between vfork and exec ↵Denys Vlasenko
could mess things up While at it, rename bb_signals_recursive_norestart() to bb_signals_norestart(): "recursive" was implying we are setting SA_NODEFER allowing signal handler to be entered recursively, but we do not do that. function old new delta bb_signals_norestart - 70 +70 startservice 380 394 +14 bb_signals_recursive_norestart 70 - -70 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/0 up/down: 84/-70) Total: 14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-04ls: don't output any colors with TERM=dumbSören Tempel
The TERM variable is usually set to "dumb" to indicate that the terminal does not support any ANSI escape sequences. Presently, ls does not honor this variable and outputs colors anyhow which results in unreadable output, unless the user explicitly disables colors using `ls --color=never`. The rational behind this change is that ls should "just work" by default, even on dumb terminals. For this reason, this patch adds a check which additionally consults the TERM variable before printing any colors. This is analogous to the existing check for ensuring that standard output is a tty. As such, colors can still be forced with `--color=force`, even if TERM is set to dumb. function old new delta is_TERM_dumb - 40 +40 ls_main 579 598 +19 .rodata 103246 103251 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 64/0) Total: 64 bytes Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-24libbb.h: inline byteswapsDenys Vlasenko
function old new delta recv_and_process_peer_pkt 2173 2245 +72 machtime_dg 97 114 +17 machtime_stream 29 45 +16 fmt_time_bernstein_25 132 139 +7 aesgcm_GHASH 183 184 +1 dumpleases_main 519 516 -3 __bswap_32 3 - -3 udhcp_run_script 743 739 -4 tls_xread_record 634 630 -4 select_lease_time 56 52 -4 rdate_main 260 256 -4 get_prefix 327 323 -4 udhcp_listen_socket 185 180 -5 sha1_process_block64 361 356 -5 sendping6 81 76 -5 sendping4 107 102 -5 read32 27 22 -5 ll_proto_a2n 112 107 -5 bb_lookup_port 102 97 -5 udhcpc_main 2615 2609 -6 tftpd_main 579 573 -6 str2sockaddr 558 552 -6 GMULT 136 130 -6 sha1_end 73 66 -7 ntpd_main 1361 1354 -7 ntohl 7 - -7 inet_addr_match 93 86 -7 htonl 7 - -7 do_iplink 1259 1252 -7 do_add_or_delete 1138 1131 -7 create_and_bind_or_die 117 110 -7 bind_for_passive_mode 124 117 -7 xconnect_ftpdata 98 90 -8 rpm_getint 118 110 -8 read_leases 304 296 -8 read_config 216 208 -8 udhcp_send_kernel_packet 336 327 -9 udhcp_recv_kernel_packet 143 134 -9 sha256_process_block64 451 442 -9 d6_send_kernel_packet_from_client_data_ifindex 275 266 -9 write_leases 215 205 -10 wget_main 2518 2508 -10 udhcpd_main 1528 1518 -10 tftp_protocol 2019 2009 -10 ftpd_main 2159 2149 -10 des_crypt 1318 1308 -10 send_ACK 138 127 -11 ipaddr_modify 1618 1607 -11 udhcp_str2optset 650 638 -12 init_d6_packet 115 103 -12 xwrite_encrypted 512 499 -13 tls_handshake 2060 2047 -13 pscan_main 607 594 -13 perform_d6_release 240 227 -13 ip_port_str 135 122 -13 handle_incoming_and_exit 2230 2217 -13 INET_setroute 751 737 -14 traceroute_init 1153 1137 -16 nc_main 1055 1039 -16 udhcp_init_header 92 75 -17 volume_id_probe_hfs_hfsplus 512 494 -18 send_offer 455 435 -20 do_lzo_decompress 507 487 -20 add_client_options 229 209 -20 ipcalc_main 554 533 -21 dhcprelay_main 966 943 -23 change_listen_mode 345 321 -24 send_packet 188 162 -26 static.xmalloc_optname_optval 709 681 -28 rpm_gettags 447 419 -28 machtime 28 - -28 catcher 299 270 -29 sfp_to_d 78 48 -30 reread_config_file 917 886 -31 lfp_to_d 84 51 -33 udhcp_recv_raw_packet 594 559 -35 nbdclient_main 1182 1145 -37 d_to_lfp 137 100 -37 lzo_compress 567 529 -38 d6_recv_raw_packet 299 254 -45 d_to_sfp 133 85 -48 d6_send_raw_packet_from_client_data_ifindex 427 379 -48 common_ping_main 1935 1887 -48 udhcp_send_raw_packet 467 416 -51 zcip_main 1219 1160 -59 udhcpc6_main 2636 2568 -68 do_lzo_compress 327 258 -69 send_arp_request 201 129 -72 common_traceroute_main 1699 1621 -78 arpping 523 437 -86 arping_main 1597 1481 -116 print_tunnel 678 550 -128 dnsd_main 1304 1164 -140 parse_args 1370 1169 -201 ------------------------------------------------------------------------------ (add/remove: 0/6 grow/shrink: 5/85 up/down: 113/-2246) Total: -2133 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-14platform.h: fix for Bionic >= 21 not having wait3()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>