aboutsummaryrefslogtreecommitdiff
path: root/miscutils (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * bc: tweak overflow detection in a^bDenys Vlasenko2021-06-121-5/+8
| | | | | | | | | | | | | | function old new delta zbc_num_p 506 510 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: code shrink: combine init() and copy() where we canDenys Vlasenko2021-06-121-21/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta bc_num_init_and_copy - 27 +27 zxc_program_popResultAndCopyToVar 495 483 -12 zxc_num_printNum 518 506 -12 zbc_num_p 518 506 -12 zxc_program_assign 357 341 -16 zbc_num_m 298 267 -31 zxc_vm_process 6498 6412 -86 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/6 up/down: 27/-169) Total: -142 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: fix for mul overflow in scale calculation in a^bDenys Vlasenko2021-06-121-8/+23
| | | | | | | | | | | | | | function old new delta zbc_num_p 516 518 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-05-144-7/+31
|\|
| * platform.h: fix for Bionic >= 21 not having wait3()Denys Vlasenko2021-04-141-0/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: --help text tweaksDenys Vlasenko2021-04-142-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * watchdog: make open-write-close-open functionality a config knobRasmus Villemoes2021-04-131-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behaviour introduced by commit 31c765081dc4 ("watchdog: stop watchdog first on startup") causes warnings in the kernel log when the nowayout feature is enabled: [ 16.212184] watchdog: watchdog0: nowayout prevents watchdog being stopped! [ 16.212196] watchdog: watchdog0: watchdog did not stop! The latter may also appear by itself in case the watchdog is of the type that cannot be stopped once started (e.g. the common always-running gpio_wdt kind). These warnings can be somewhat ominous and distracting, so allow configuring whether to use this open-write-close-open sequence rather than just open. Also saves a bit of .text when disabled: function old new delta shutdown_on_signal 31 58 +27 watchdog_main 339 306 -33 shutdown_watchdog 34 - -34 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 27/-67) Total: -40 bytes Make it default n: - It's a workaround for one specific type of watchdog (and that seems to be a defect in the kernel driver) - Even when not enabled in busybox config, it can easily be implemented outside busybox - Code size - Commit 31c765081dc4 should be considered a regression for all the boards that now end up with KERN_CRIT warnings in dmesg. - The author of that commit said "This use case is evidently rare, so if it is indeed causing problems for other people I'd OK then I understand whatever needs to be done." in the v1 thread. Cc: Matt Spinler <mspinler@linux.vnet.ibm.com> Cc: deweloper@wp.pl Cc: tito <farmatito@tiscali.it> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * timeout,top,watch,ping: parse NN.N fractional duration in locales with other ↵Denys Vlasenko2021-03-231-0/+1
| | | | | | | | | | | | separators Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-03-011-6/+58
|\|
| * bc: typo fix in commentDenys Vlasenko2021-02-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: more docs in --helpDenys Vlasenko2021-02-261-13/+14
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: document what non-GNU commands doDenys Vlasenko2021-02-261-5/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc/dc: fix length(0) and length(0.000nnn) resultDenys Vlasenko2021-02-261-4/+13
| | | | | | | | | | | | | | function old new delta zxc_vm_process 6464 6498 +34 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: correct --help textDenys Vlasenko2021-02-261-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before: Tiny RPN calculator. Operations: +, -, *, /, %, ~, ^, |, p - print top of the stack without popping f - print entire stack k - pop the value and set the precision i - pop the value and set input radix o - pop the value and set output radix After: Tiny RPN calculator. Operations: Arithmetic: + - * / % ^ ~ - divide with remainder | - modular exponentiation v - square root p - print top of the stack without popping f - print entire stack k - pop the value and set precision i - pop the value and set input radix o - pop the value and set output radix function old new delta packed_usage 33519 33565 +46 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | bc: handle ^C in interactive modeRon Yorston2021-02-141-0/+13
| |
* | bc: fix to build on WIN32 and enable in default configurationsRon Yorston2021-02-131-0/+2
| |
* | Merge branch 'busybox' into mergeRon Yorston2021-02-053-4/+4
|\|
| * libbb: introduce and use fputs_stdoutRon Yorston2021-02-033-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta fputs_stdout - 12 +12 zxc_vm_process 7237 7230 -7 yes_main 85 78 -7 write_block 380 373 -7 wrapf 305 298 -7 strings_main 437 430 -7 show_bridge 353 346 -7 rev_main 384 377 -7 put_prompt_custom 58 51 -7 put_cur_glyph_and_inc_cursor 168 161 -7 print_numbered_lines 152 145 -7 print_named_ascii 130 123 -7 print_name 135 128 -7 print_login_issue 386 379 -7 print_ascii 208 201 -7 powertop_main 1249 1242 -7 od_main 1789 1782 -7 logread_main 518 511 -7 head_main 804 797 -7 display_process_list 1319 1312 -7 cut_main 1002 995 -7 bb_dump_dump 1550 1543 -7 bb_ask_noecho 393 386 -7 baseNUM_main 702 695 -7 expand_main 755 745 -10 dumpleases_main 497 487 -10 write1 12 - -12 putcsi 37 23 -14 print_login_prompt 55 41 -14 paste_main 525 511 -14 cat_main 440 426 -14 print_it 245 230 -15 print_addrinfo 1188 1171 -17 print_rule 770 750 -20 print_linkinfo 842 822 -20 httpd_main 791 771 -20 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/34 up/down: 12/-341) Total: -329 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-01-1418-111/+142
|\|
| * bc: code shrinkDenys Vlasenko2021-01-061-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: ^C on input line exits (unlike ^C during calculations, which does not)Denys Vlasenko2021-01-041-10/+10
| | | | | | | | | | | | | | function old new delta xc_read_line 353 344 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in ↵Denys Vlasenko2020-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shells function old new delta xgettimeofday - 11 +11 get_local_var_value 280 281 +1 svlogd_main 1323 1322 -1 change_epoch 67 66 -1 timestamp_and_log 461 458 -3 hwclock_main 301 298 -3 fmt_time_bernstein_25 135 132 -3 step_time 331 326 -5 script_main 1207 1202 -5 machtime 34 28 -6 curtime 61 54 -7 ts_main 423 415 -8 nmeter_main 761 751 -10 gettime1900d 67 46 -21 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/12 up/down: 12/-73) Total: -61 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: use fopen helpers where appropriateDenys Vlasenko2020-12-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta finalize 348 343 -5 parse_resolvconf 306 299 -7 list_i2c_busses_and_exit 495 483 -12 bootchartd_main 1091 1076 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-39) Total: -39 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc,dc: make BC_LINE_LENGTH/DC_LINE_LENGTH more compatible with GNUDenys Vlasenko2020-12-291-15/+23
| | | | | | | | | | | | | | function old new delta xc_vm_init 640 682 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: placate gcc (it thinks 's' can be uninitialized here)Denys Vlasenko2020-12-291-8/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2020-12-293-5/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * man: implement SECTION parametersDenys Vlasenko2020-12-271-6/+35
| | | | | | | | | | | | | | | | | | | | function old new delta man_main 807 942 +135 is_section_name - 52 +52 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 187/0) Total: 187 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: do not allocate line editing state until neededDenys Vlasenko2020-12-211-19/+18
| | | | | | | | | | | | | | | | | | | | | | function old new delta xc_read_line 324 353 +29 free_line_input_t 34 39 +5 xc_vm_init 656 640 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-16) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add and use infrastructure for fixed page size optimizationDenys Vlasenko2020-12-143-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * more --help text tweaksDenys Vlasenko2020-12-131-1/+1
| | | | | | | | | | | | | | function old new delta packed_usage 33545 33581 +36 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * help text tweaksDenys Vlasenko2020-12-132-2/+2
| | | | | | | | | | | | | | function old new delta packed_usage 33547 33545 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * decrease padding: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-302-3/+3
| | | | | | | | | | | | | | | | text data bss dec hex filename 1021236 559 5052 1026847 fab1f busybox_old 1021120 559 5052 1026731 faaab busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-308-18/+12
| | | | | | | | | | | | | | | | text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: introduce and use msleep()Denys Vlasenko2020-11-292-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta msleep - 45 +45 watchdog_main 271 266 -5 common_traceroute_main 3546 3530 -16 beep_main 277 248 -29 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 45/-50) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * use write_str() functions where appropriateDenys Vlasenko2020-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | function old new delta chat_main 1300 1295 -5 finalize_tty_attrs 80 70 -10 getty_main 1538 1519 -19 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-34) Total: -34 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: introduce and use sleep1()Denys Vlasenko2020-11-292-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta sleep1 - 9 +9 run_shutdown_and_kill_processes 97 95 -2 restore_state_and_exit 116 114 -2 reread_partition_table 67 65 -2 flush_buffer_cache 80 78 -2 chat_main 1302 1300 -2 timeout_main 310 307 -3 telnet_main 1235 1232 -3 stop_handler 86 83 -3 process_action 1078 1075 -3 nbdclient_main 1185 1182 -3 init_main 789 786 -3 getty_main 1541 1538 -3 do_time 410 407 -3 runsv_main 1682 1677 -5 pause_and_low_level_reboot 59 54 -5 inetd_main 1917 1911 -6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/16 up/down: 9/-50) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-08-2319-45/+17
|\|
| * build system: drop PLATFORM_LINUXRon Yorston2020-08-1318-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PLATFORM_LINUX is a hidden configuration option which is disabled by default and enabled at over a hundred locations for features that are deemed to be Linux specific. The only effect of PLATFORM_LINUX is to control compilation of libbb/match_fstype.c. This file is only needed by mount and umount. Remove all references to PLATFORM_LINUX and compile match_fstype.c if mount or umount is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lsscsi: code shrinkDenys Vlasenko2020-07-201-15/+12
| | | | | | | | | | | | | | | | | | | | function old new delta lsscsi_main 298 302 +4 get_line 56 45 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-11) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * crontab: Fix -e with editors saving using renaming strategyGray Wolf2020-07-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some editors (like vim) use renaming strategy to save file. That means they save a file to some random name and then rename it to final location. The advantage is that such save is atomic. However, crontab -e holds open fd to the temporary file, meaning it never sees the changes. The temporary file needs to be re-opened after the editor terminates for the changes to properly save. Fixes #12491 Signed-off-by: Gray Wolf <wolf@wolfsden.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ts: correct output in 64-bit buildRon Yorston2020-07-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | ts failed to output the correct time when built for 64-bit Windows. In 64-bit builds time_t is a 64-bit quantity whereas the tv_sec member of struct timeval is 32-bit. https://sourceforge.net/p/mingw-w64/bugs/783/ Use a temporary time_t value in 64-bit builds.
* | Merge branch 'busybox' into mergeRon Yorston2020-07-092-0/+3
|\|
| * bc: placate a "defined but not used" warningDenys Vlasenko2020-06-241-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2020-06-231-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeFRP-3466-g53c09d0e1Ron Yorston2020-05-291-0/+15
|\|
| * mim: run scripts from a specification fileRon Yorston2020-04-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mim runs scripts from a specification file which can be thought of as an extremely limited Makefile. Neither make variables nor dependencies are supported. By default the file 'Mimfile' is read. An example: hello: echo hello $1 clean: rm -rf * The command 'mim' or 'mim hello' will echo 'hello'. Unlike 'make' arguments after the first are available to the script; they don't specify additional targets. mim isn't enabled by default. Enabling it increases the size of the binary by about 500 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | inotifyd: WIN32 portRon Yorston2020-04-151-0/+211
| | | | | | | | | | | | | | | | | | | | | | | | Use ReadDirectoryChangesW to implement inotifyd for WIN32. There are limitations: - It's only possible to watch directories, not files. - The notification doesn't distinguish between different changes to file state. All changes other than creation, deletion and renaming are reported as 'c'.
* | Fix POSIX buildFRP-3445-g10e14d5ebRon Yorston2020-04-111-1/+1
| |
* | time: WIN32 portRon Yorston2020-04-061-0/+55
| | | | | | | | | | | | | | | | Port the time applet to WIN32. This requires the implemntation of a replacement for wait3(2). Only elapsed, user and system times are supported, not the memory and i/o statistics reported by GNU time.
* | iconv: minor fixesRon Yorston2020-02-181-13/+14
| | | | | | | | | | | | | | Add an explicit test for EOF. Otherwise when processing input from interactive stdin it's necessary to enter ^Z twice to signal EOF. Allow '-' to be mixed with actual file names on the command line.