aboutsummaryrefslogtreecommitdiff
path: root/libbb (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libbb/lineedit: scroll to cursor position on any keypressRon Yorston2016-04-261-3/+5
| | | | | Also improve erase_till_end_of_screen. Based on suggestions from GitHub user avih.
* winansi: fix a couple of small problemsRon Yorston2016-04-251-0/+3
| | | | | Clear the last line; move to cursor position before clearing screen with ^L.
* mingw: enable busybox --install by defaultRon Yorston2016-04-061-2/+40
| | | | | | | | | | | Allow FEATURE_INSTALLER to be configured and enable it in the default configuration. The behaviour is slightly different from upstream BusyBox: symbolic links are not permitted; if no target directory is provided the directory containing the busybox binary is used as the target.
* Merge branch 'busybox' into mergeRon Yorston2016-04-049-96/+254
|\
| * find_applet_by_name: loop index should be signedRon Yorston2016-04-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | The loop for (j = ARRAY_SIZE(applet_nameofs)-1; j >= 0; j--) { was intended to terminate when j goes negative, so j needs to be signed. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace and namespace cleanupsDenys Vlasenko2016-04-031-4/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ubirmvol: Implement -N switch for ubirmvolSven Eisenberg2016-04-031-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_volid_by_name - 125 +125 ubi_devnum_from_devname - 43 +43 ubi_tools_main 1215 1220 +5 packed_usage 30674 30655 -19 ubirename_main 394 221 -173 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 1/2 up/down: 173/-192) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: speed up error_msg functionsDenys Vlasenko2016-04-031-4/+25
| | | | | | | | | | | | | | function old new delta bb_verror_msg 386 466 +80 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * main(): add a TODO about finding a use for _end[] areaDenys Vlasenko2016-04-031-0/+13
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * typo fixDenys Vlasenko2016-04-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * find_applet_by_name: add an example of faster linear search codeDenys Vlasenko2016-04-021-3/+77
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nsenter,unshare: share common code; fix a bug of not closing all fdsDenys Vlasenko2016-04-022-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta xvfork_parent_waits_and_exits - 64 +64 exec_prog_or_SHELL - 39 +39 unshare_main 873 810 -63 nsenter_main 663 596 -67 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 106/-130) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: two new functions: wait_for_exitstatus(pid), xfchdir(fd)Denys Vlasenko2016-04-012-0/+18
| | | | | | | | | | | | Bartosz Golaszewski proposed xfchdir() Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcp: get rid of bb_info_msg()Denys Vlasenko2016-03-302-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta udhcpd_main 1501 1531 +30 d6_recv_raw_packet 251 264 +13 perform_d6_release 188 198 +10 udhcpc6_main 2443 2449 +6 udhcp_recv_raw_packet 582 588 +6 udhcp_recv_kernel_packet 132 138 +6 send_d6_renew 140 146 +6 d6_recv_kernel_packet 118 124 +6 send_renew 77 82 +5 send_discover 85 90 +5 send_decline 84 89 +5 send_d6_select 97 102 +5 send_d6_discover 174 179 +5 perform_release 167 172 +5 count_lines 72 74 +2 udhcpc_main 2836 2837 +1 bb_info_msg 125 - -125 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 17/4 up/down: 117/-180) Total: -63 bytes text data bss dec hex filename 924935 906 17160 943001 e6399 busybox_old 924736 906 17160 942802 e62d2 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * applet_tables: save space by removing applet name offsetsRon Yorston2016-03-302-30/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array applet_nameofs consumes two bytes per applet. It encodes nofork/noexec flags suid flags the offset of the applet name in the applet_name string Change the applet_table build tool to store the flags in two separate arrays (applet_flags and applet_suid). Replace applet_nameofs[] with a smaller version that only stores a limited number of offsets. This requires changes to the macros APPLET_IS_NOFORK, APPLET_IS_NOEXEC and APPLET_SUID. According to Valgrind the original find_applet_by_name required 353 cycles per call, averaged over all names. Adjusting the number of known offsets allows space to be traded off against execution time: KNOWN_OFFSETS cycles bytes (wrt KNOWN_OFFSETS = 0) 0 9057 - 2 4604 32 4 2407 75 8 1342 98 16 908 130 32 884 194 This patch uses KNOWN_OFFSETS = 8. v2: Remove some dead code from the applet_table tool; Treat the applet in the middle of the table as a special case. v3: Use the middle applet to adjust the start of the linear search as well as the last applet found. v4: Use an augmented linear search in find_applet_by_name. Drop the special treatment of the middle name from get_applet_name: most of the advantage now derives from the last stored value. v5: Don't store index in applet_nameofs, it can be calculated. v6: Tweaks by Denys function old new delta find_applet_by_name 25 125 +100 applet_suid - 92 +92 run_applet_no_and_exit 452 460 +8 run_applet_and_exit 695 697 +2 applet_name_compare 31 - -31 applet_nameofs 734 14 -720 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 3/1 up/down: 202/-751) Total: -549 bytes text data bss dec hex filename 925464 906 17160 943530 e65aa busybox_old 924915 906 17160 942981 e6385 busybox_unstripped Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-02-222-3/+9
|\|
| * chpasswd: support -c argument and respect DEFAULT_PASSWD_ALGOPascal Bach2015-12-181-3/+7
| | | | | | | | | | Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Resolve linker issues with Android API 21 (dprintf, tcdrain)Chris Renshaw2015-12-171-0/+2
| | | | | | | | | | Signed-off-by: Chris Renshaw <osm0sis@outlook.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libbb: additional support for backslashes in pathsRon Yorston2015-11-131-0/+21
| |
* | win32: improve implementation of statfsRon Yorston2015-11-011-1/+1
| | | | | | | | The WIN32 calls should be passed the root directory of the filesystem.
* | Merge branch 'busybox' into mergeRon Yorston2015-10-318-91/+37
|\|
| * lineedit: FEATURE_REVERSE_SEARCH should not depend on SAVEHISTORYDenys Vlasenko2015-10-301-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: search applets as well as PATH for tab completionRon Yorston2015-10-301-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In standalone shell mode search the applet table as well as PATH when tab completing a command. Use a stupid linear search: we're also about to read all the directories on PATH so efficiency isn't a big concern. function old new delta add_match - 53 +53 complete_cmd_dir_file 687 724 +37 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 90/0) Total: 90 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * busybox: alter help message in standalone shell modeRon Yorston2015-10-301-0/+9
| | | | | | | | | | Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tweak defconfigDenys Vlasenko2015-10-251-4/+4
| | | | | | | | | | | | | | | | MONOTONIC_SYSCALL=y by default FEATURE_LAST_SMALL is gone: now FEATURE_LAST_FANCY is a "bool", not a "choice". Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * pmap: fix bogus {no such process} comm field textDenys Vlasenko2015-10-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | function old new delta read_cmdline 246 266 +20 procps_get_maps 196 193 -3 packed_usage 30413 30404 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 20/-12) Total: 8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tidy up strtok useDenys Vlasenko2015-10-231-4/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: if stderr is not a tty, progress bar shouldn't use tty-tricksDenys Vlasenko2015-10-231-3/+8
| | | | | | | | | | | | | | function old new delta bb_progress_update 706 768 +62 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: factor out code which queries screen widthDenys Vlasenko2015-10-233-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_terminal_width - 17 +17 stty_main 1196 1197 +1 pstree_main 321 319 -2 ls_main 735 731 -4 watch_main 232 225 -7 bb_progress_update 714 706 -8 ps_main 555 543 -12 run_applet_and_exit 708 695 -13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 18/-46) Total: -28 byte Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * remove systemd supportDenys Vlasenko2015-10-221-62/+0
| | | | | | | | | | | | | | systemd people are not willing to play nice with the rest of the world. Therefore there is no reason for the rest of the world to cooperate with them. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-193-10/+5
|\|
| * libbb: get_uidgid() always called with allow_numeric=1Denys Vlasenko2015-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | function old new delta xget_uidgid 30 25 -5 make_device 2188 2183 -5 main 797 792 -5 get_uidgid 240 225 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * du: extra compat: with -k and -m, round sizes upDenys Vlasenko2015-10-151-8/+3
| | | | | | | | | | | | | | function old new delta print 36 65 +29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libiproute: rename invarg(a,b) to invarg_1_to_2(a,b)Denys Vlasenko2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | invarg(a,b) - "invalid argument", but how a and b enter the message? invarg_1_to_2(a,b) is somewhat easier to read: "invalid argument 'a' to 'b'" Audit of usage revealed a number of bad uses, with too long messages. text data bss dec hex filename 938848 932 17448 957228 e9b2c busybox_old 938788 932 17448 957168 e9af0 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-1315-121/+162
|\|
| * libbb: introduce kernel-style BUILD_BUG_ON()Denys Vlasenko2015-10-131-3/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * use auto_string() where appropriate to kill a few staticsDenys Vlasenko2015-10-092-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Custom linker script 'busybox_ldscript' found, using it function old new delta static.str 4 - -4 static.passwd 4 0 -4 bb_ask 322 311 -11 ether_print 63 47 -16 UNSPEC_print 82 66 -16 INET_sprint 59 38 -21 INET6_sprint 54 30 -24 make_human_readable_str 292 235 -57 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/7 up/down: 0/-153) Total: -153 bytes text data bss dec hex filename 939880 992 17480 958352 e9f90 busybox_old 939736 992 17456 958184 e9ee8 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: auto_string() for efficient handling of temporary malloced stirngsDenys Vlasenko2015-10-092-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it in libiproute: get rid of one static string buffer. function old new delta auto_string - 51 +51 ll_index_to_name 10 49 +39 buffer_fill_and_print 169 178 +9 scan_recursive 378 380 +2 decode_one_format 732 734 +2 cmdputs 334 332 -2 static.cur_saved 4 1 -3 static.nbuf 16 - -16 printable_string 94 57 -37 ll_idx_n2a 53 - -53 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 4/3 up/down: 103/-111) Total: -8 bytes text data bss dec hex filename 939880 992 17496 958368 e9fa0 busybox_old 939880 992 17480 958352 e9f90 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * remove global "jmp_buf die_jmp" from !FEATURE_PREFER_APPLETS buildsDenys Vlasenko2015-10-093-45/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta xfunc_has_died - 21 +21 sleep_much - 12 +12 sleep10 - 9 +9 die_func - 4 +4 fflush_stdout_and_exit 35 36 +1 builtin_type 121 119 -2 die_sleep 4 - -4 xfunc_die 60 24 -36 hush_main 1128 1011 -117 die_jmp 156 - -156 ------------------------------------------------------------------------------ (add/remove: 4/2 grow/shrink: 1/3 up/down: 47/-315) Total: -268 bytes text data bss dec hex filename 939992 992 17652 958636 ea0ac busybox_old 939880 992 17496 958368 e9fa0 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * md5sum: code shrinkDenys Vlasenko2015-10-071-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | For CONFIG_MD5_SMALL=1: function old new delta md5_process_block64 925 881 -44 For CONFIG_MD5_SMALL=0: function old new delta md5_process_block64 1603 1586 -17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: more compact API for bb_parse_mode()Denys Vlasenko2015-10-071-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta make_device 2182 2188 +6 parse_command 1440 1443 +3 parse_params 1497 1499 +2 install_main 773 769 -4 mkdir_main 168 160 -8 getoptscmd 641 632 -9 builtin_umask 158 147 -11 bb_parse_mode 431 410 -21 umaskcmd 286 258 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/6 up/down: 11/-81) Total: -70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: another unit test for is_suffixed_withTito Ragusa2015-09-151-0/+1
| | | | | | | | | | | | | | Suggested by Bartosz Golaszewski. Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make is_suffixed_with() return pointer inside string, not key.Denys Vlasenko2015-08-251-2/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add is_suffixed_with() functionBartosz Golaszewski2015-08-251-0/+33
| | | | | | | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add a comment describing the way is_prefixed_with() worksBartosz Golaszewski2015-08-251-0/+5
| | | | | | | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add unit tests for is_prefixed_with()Bartosz Golaszewski2015-08-251-0/+19
| | | | | | | | | | | | | | Test corner cases too like looking for an empty prefix etc. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add setsockopt_foo helpersDenys Vlasenko2015-08-243-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta setsockopt_int - 23 +23 do_load 918 934 +16 setsockopt_SOL_SOCKET_int - 14 +14 setsockopt_keepalive - 10 +10 setsockopt_SOL_SOCKET_1 - 10 +10 buffer_fill_and_print 169 178 +9 setsockopt_1 - 8 +8 nfsmount 3560 3566 +6 redirect 1277 1282 +5 tcpudpsvd_main 1782 1786 +4 d6_send_kernel_packet 272 275 +3 i2cget_main 380 382 +2 ed_main 2544 2545 +1 scan_recursive 380 378 -2 nbdclient_main 492 490 -2 hash_find 235 233 -2 cmdputs 334 332 -2 parse_command 1443 1440 -3 static.two 4 - -4 ntpd_main 1039 1035 -4 const_int_1 4 - -4 const_IPTOS_LOWDELAY 4 - -4 RCVBUF 4 - -4 ntp_init 474 469 -5 change_listen_mode 316 310 -6 uevent_main 416 409 -7 arping_main 1697 1690 -7 telnet_main 1612 1603 -9 socket_want_pktinfo 42 33 -9 setsockopt_reuseaddr 21 10 -11 setsockopt_broadcast 21 10 -11 httpd_main 772 757 -15 get_remote_transfer_fd 109 94 -15 make_new_session 503 487 -16 ftpd_main 2177 2160 -17 read_bunzip 1896 1866 -30 common_traceroute_main 4099 4058 -41 common_ping_main 1836 1783 -53 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 8/21 up/down: 111/-283) Total: -172 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unit-tests: remove code depending on WANT_TIMINGBartosz Golaszewski2015-08-171-27/+3
| | | | | | | | | | | | | | | | | | | | Since there is no interest in merging a config option for WANT_TIMING, remove the parts of code depending on it altogether. While we're at it: add some newlines to improve readability. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unit-tests: remove unnecesary field from struct bbunit_listelemBartosz Golaszewski2015-08-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the initial submission struct bbunit_listelem was manipulated by custom list functions implemented in bbunit.c. Since the tests are now added to the list by llist_add_to_end(), which allocates the llist_t objects behind the scenes, there's no need for the *next field. function old new delta unit_main 142 141 -1 bbunit_strrstr_elem 24 16 -8 bbunit_obscure_weak_pass_elem 24 16 -8 bbunit_obscure_strong_pass_elem 24 16 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-25) Total: -25 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-08-042-2/+6
|\|