aboutsummaryrefslogtreecommitdiff
path: root/coreutils (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-305-7/+7
| | | | | | | | | | | | | | | | 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 sleep1()Denys Vlasenko2020-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * libbb: in @SECONDS date format, use 64-bit time if libc allowsDenys Vlasenko2020-11-281-0/+1
| | | | | | | | | | | | | | | | function old new delta packed_usage 33472 33486 +14 parse_datestr 919 916 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: tweak --help: -D FMT is used for -s TIME as wellDenys Vlasenko2020-11-281-26/+19
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: remove non-standard special-casing of date '+%f'Denys Vlasenko2020-11-281-4/+0
| | | | | | | | | | | | | | | | | | git log did not reveal why it is there. function old new delta date_main 1016 995 -21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: trim --help (no need to show long opts)Denys Vlasenko2020-11-281-19/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: support -Ins, more compatible timezone display in -IDenys Vlasenko2020-11-281-7/+19
| | | | | | | | | | | | | | | | | | | | function old new delta date_main 941 1016 +75 static.isoformats 28 31 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 78/0) Total: 78 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: for -uR and -uIh, timezone still have to be shown at +hhmm, not as ↵Denys Vlasenko2020-11-281-5/+3
| | | | | | | | | | | | | | | | | | abbreviation function old new delta date_main 963 941 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix commentsDenys Vlasenko2020-11-281-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sha3sum: fix --help: -a does not depend on FEATURE_MD5_SHA1_SUM_CHECKDenys Vlasenko2020-11-271-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * base32/64: decode in-placeDenys Vlasenko2020-11-271-5/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * base32/64: implement -w COLDenys Vlasenko2020-11-271-22/+34
| | | | | | | | | | | | | | | | | | | | function old new delta baseNUM_main 568 655 +87 packed_usage 33478 33533 +55 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 142/0) Total: 142 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * base32: new appletDenys Vlasenko2020-11-261-10/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta baseNUM_main - 568 +568 decode_base32 - 275 +275 bb_uuenc_tbl_base32 - 34 +34 read_base64 218 236 +18 applet_names 2732 2739 +7 applet_main 1580 1584 +4 packed_usage 33480 33478 -2 base64_main 208 - -208 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 3/1 up/down: 906/-210) Total: 696 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-11-124-15/+95
|\|
| * shell: better support of [[ ]] bashismDenys Vlasenko2020-10-311-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Still rather rudimentary for ash function old new delta binop 433 589 +156 check_operator 65 101 +36 done_word 736 769 +33 test_main 405 418 +13 parse_stream 2227 2238 +11 ops_texts 124 133 +9 ops_table 80 86 +6 run_pipe 1557 1562 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/0 up/down: 269/0) Total: 269 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * uudecode: fix possible signed char bugDenys Vlasenko2020-10-071-4/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: shrink recursive_action() by reducing memory pressureDenys Vlasenko2020-10-012-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta recursive_action1 - 316 +316 file_action_grep 161 164 +3 add_to_prg_cache_if_socket 202 205 +3 depmod_main 509 511 +2 writeFileToTarball 488 489 +1 parse_module 281 282 +1 fileAction 207 208 +1 act 189 190 +1 add_to_dirlist 65 64 -1 writeTarFile 196 194 -2 uuidcache_init 47 45 -2 uuidcache_check_device 109 107 -2 true_action 8 6 -2 run_parts_main 310 308 -2 netstat_main 534 532 -2 lsusb_main 29 27 -2 lspci_main 45 43 -2 initial_scan 138 136 -2 grep_main 845 843 -2 find_main 482 480 -2 config_file_action 437 435 -2 chmod_main 142 140 -2 dirAction 14 10 -4 diff_main 1544 1540 -4 chown_main 154 148 -6 skip_dir 136 129 -7 dir_act 191 184 -7 recursive_action 453 69 -384 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 7/20 up/down: 328/-439) Total: -111 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash, ls: improve support for 'c:path'Ron Yorston2020-08-281-0/+5
| | | | | | | | | | | | | | | | | | | | Revert commit 249f68e3c (win32: append '/' to bare drive name in opendir). Instead add better handling for paths of the form 'c:path' to ls and expmeta() in ash. Adds 64 bytes.
* | printf: ensure '\045' is printed as '%'Ron Yorston2020-08-281-5/+10
| | | | | | | | | | | | | | | | | | Using printf() instead of fputs() to save a few bytes was a false economy. printf() eats percent signs. See GitHub issue #199. Adds 32 bytes.
* | printf: prevent '\0' in format string from truncating outputFRP-3578-g359211429Ron Yorston2020-08-241-1/+9
| | | | | | | | | | | | | | | | | | Commit 4a2af48e6 (printf: emit more contiguous text to improve escape sequences) didn't treat an escaped null byte in the format string correctly. The output string was truncated at the null byte. Detect this case, output the partial string and the null byte and carry on.
* | Merge branch 'busybox' into mergeRon Yorston2020-08-232-2/+0
|\|
| * build system: drop PLATFORM_LINUXRon Yorston2020-08-132-2/+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>
* | ls: allow backslashes to be replaced in displayed pathsfix_backslashRon Yorston2020-08-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally 'ls' displays paths exactly as the user enters them: $ ls .//file .//file In busybox-w32 paths using backslash as a separator are displayed in a form that can't be reused as input to the shell: $ ls .\\file .\file Allow backslashes to be replaced with forward slashes if the environment variable BB_FIX_BACKSLASH is set to 1. See GitHub issue #196.
* | build system: reinstate PLATFORM_LINUXRon Yorston2020-08-031-0/+1
| | | | | | | | | | | | | | Removing 'select PLATFORM_LINUX' from ps and stat has no material effect: it just causes match_fstype.o to be built needlessly. Remove this difference from upstream.
* | win32: code shrink kill(2)Ron Yorston2020-07-251-1/+1
| | | | | | | | | | | | | | | | - Drop exit_code argument from kill_SIGTERM_by_handle() - Pass signal number rather than exit code to other functions - Merge kill_SIGKILL() and kill_SIGTEST() Saves 112 bytes.
* | Merge branch 'busybox' into mergeRon Yorston2020-07-091-4/+4
|\|
| * unexpand: correct behavior for --first-only --tabs=4Mark Edgar2020-06-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to the patch, both -f and --first-only are in all cases either no-op or ignored. Without --tabs, --first-only is the default so specifying it is a no-op. With --tabs, --all is implied, and --first-only is intended to reset this. function old new delta expand_main 690 694 +4 Signed-off-by: Mark Edgar <medgar123@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ls: treat hidden files as if their names begin with a dotRon Yorston2020-07-091-0/+12
| | | | | | | | | | | | | | On Unix 'ls' treats filenames starting with a dot as hidden and only displays them if the '-a' or '-A' option is given. Extend similar treatment to files with the Windows hidden flag.
* | printf: emit more contiguous text to improve escape sequencesRon Yorston2020-06-041-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users have a reasonable expectation that printf should be able to construct ANSI escape sequences and have them take effect. This expectation isn't met because printf tends to output one character at a time whereas busybox-w32 needs escape sequences to be output contiguously Force printf to output contiguous text in two cases: - literal text in the format string - string arguments output using the '%b' format specifier (See GitHub issue #189.)
* | dd: fix handling of 'conv=notrunc seek=N'Ron Yorston2020-05-201-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e6680912a (dd: create a sparse file when seek=N is used) broke the use of 'conv=notrunc seek=N' to modify existing files. Rename seek_sparse() to make_sparse() and: - add an argument to specify the start of the sparse region; - call make_sparse() before ftruncate(); - call make_sparse() only if: * we can determine the size of the file; * the file is not open in append mode; * the file is being extended. This should fix GitHub issue #186.
* | timeout: fix utter brokennessRon Yorston2020-03-291-0/+1
| | | | | | | | | | The merge from upstream (commit d89ced75b, 2018-09-10) completely broke timeout. Apply a belated fix.
* | dd: create a sparse file when seek=N is usedRon Yorston2020-03-241-0/+3
| | | | | | | | | | | | | | When the seek=N argument is used mark the file as sparse and set the range that is sparse. See https://stackoverflow.com/questions/4011508/how-to-create-a-sparse-file-on-ntfs
* | date: code shrinkRon Yorston2020-02-111-0/+27
| | | | | | | | | | | | | | Since we don't have a working clock_settime(2) there's no point in claiming to support the '-s' option. Saves 96 bytes
* | Merge branch 'busybox' into mergeRon Yorston2020-01-085-17/+51
|\|
| * Remove stime() function callsAlistair Francis2019-11-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stime() has been deprecated in glibc 2.31 and replaced with clock_settime(). Let's replace the stime() function calls with clock_settime() in preperation. function old new delta rdate_main 197 224 +27 clock_settime - 27 +27 date_main 926 941 +15 stime 37 - -37 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * chgrp: correct the usage for non-desktop chgrp callsLiu, Shuang (ADITG/ESM)2019-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When IF_DESKTOP is not defined, chown and chgrp only takes option -R -h, However the usage output of chgrp is wrong: $ ./busybox.nosuid chown Usage: chown [-Rh]... USER[:[GRP]] FILE... $ ./busybox.nosuid chgrp Usage: chgrp [-RhLHP]... GROUP FILE... $ ./busybox.nosuid chgrp -H group dummy chgrp: invalid option -- 'H' Usage: chgrp [-RhLHP]... GROUP FILE... The chgrp is now a wrapper of chown, so the recognized options shall be the same. This is introduced by 34425389e09353a8dacdd6b23a62553f699c544c I would expect the correct behavior shall be the same as chown. So suggest the below patch, the behavior shall be: $ ./busybox.nosuid chgrp Usage: chgrp [-Rh]... GROUP FILE... Signed-off-by: Shuang Liu <sliu@de.adit-jv.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * clang/llvm 9 fix - do not eliminate a store to a fake "const"Denys Vlasenko2019-10-251-1/+1
| | | | | | | | | | | | | | This is *much* better (9 kbytes better) than dropping "*const" optimization trick. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Remove syscall wrappers around clock_gettime, closes 12091Denys Vlasenko2019-10-241-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12091 "Direct use of __NR_clock_gettime is not time64-safe". function old new delta runsv_main 1698 1712 +14 startservice 378 383 +5 get_mono 31 25 -6 date_main 932 926 -6 gettimeofday_ns 17 - -17 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 2/2 up/down: 19/-29) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * date: Use 64 prefix syscall if we have toAlistair Francis2019-10-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some 32-bit architectures no longer have the 32-bit time_t syscalls. Instead they have suffixed syscalls that returns a 64-bit time_t. If the architecture doesn't have the non-suffixed syscall and is using a 64-bit time_t let's use the suffixed syscall instead. This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel headers. If an architecture only supports the suffixed syscalls, but is still using a 32-bit time_t fall back to the libc call. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ln: --no-target-directory implies --no-dereferenceKaarle Ritvanen2019-10-081-4/+21
| | | | | | | | | | | | | | as in GNU coreutils Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tee: do not intercept SIGPIPEDenys Vlasenko2019-10-071-4/+20
| | | | | | | | | | | | | | | | | | GNU tee does this only with -p, which we don't have yet. function old new delta tee_main 306 295 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-08-1626-101/+127
|\|
| * stat: print nanosecond times, fix printing of empty linesDenys Vlasenko2019-08-031-39/+36
| | | | | | | | | | | | | | function old new delta human_time 36 73 +37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-0225-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * expand: add commented-out code to handle NULsDenys Vlasenko2019-06-091-8/+35
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * expand,unexpand: drop broken test, add FIXME commentDenys Vlasenko2019-06-081-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-05-273-15/+15
|\|
| * ls: fix SEGV when --color is used and ENABLE_LS_COLOR=nDenys Vlasenko2019-05-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: fix handling of short result of full_write(), closes 11711Denys Vlasenko2019-05-141-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | $ dd bs=1G <sda1 of=/dev/sda1 dd: error writing '/dev/sda1': No space left on device 1+0 records in 0+0 records out 999292928 bytes (953.0MB) copied, 0.784617 seconds, 1.2GB/s function old new delta write_and_stats 99 102 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ln: correct 'ln -T' usage messageJohn L. Hammond2019-05-091-1/+1
| | | | | | | | | | Signed-off-by: John L. Hammond <jhammond@indeed.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>