Commit Graph

48 Commits

Author SHA1 Message Date
Denys Vlasenko
c2bd0b6806 timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-03-23 13:50:02 +01:00
Ron Yorston
cad3fc743a libbb: introduce and use fputs_stdout
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>
2021-02-03 20:52:40 +01:00
Ron Yorston
5c69ad0ecd build system: drop PLATFORM_LINUX
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>
2020-08-13 17:12:56 +02:00
Denys Vlasenko
df1f479fc5 randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23 03:13:55 +02:00
Denys Vlasenko
6eb38fded2 randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23 02:46:53 +02:00
Denys Vlasenko
37a9008f8e brctl: code shrink
function                                             old     new   delta
show_bridge                                          323     317      -6
brctl_main                                          2171    2164      -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-13)             Total: -13 bytes
   text	   data	    bss	    dec	    hex	filename
1002083	    551	   5612	1008246	  f6276	busybox_old
1002065	    551	   5612	1008228	  f6264	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-15 12:31:54 +02:00
Denys Vlasenko
eb1395147a brctl: tweak help text, fix comments
function                                             old     new   delta
packed_usage                                       33255   33236     -19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12 19:51:46 +02:00
Denys Vlasenko
b4fa16d5ed brctl: fold show_bridge_ports_ into its caller
function                                             old     new   delta
brctl_main                                          2235    2171     -64

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12 19:42:37 +02:00
Denys Vlasenko
3398753818 brctl: code shrink
packed_usage                                       33253   33255      +2
write_uint                                            96      90      -6
show_bridge_timer                                     93      69     -24
brctl_main                                          2338    2235    -103
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-133)           Total: -131 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12 19:24:38 +02:00
Martin Lewis
6dcf563633 brctl: add support for showstp command
function                                             old     new   delta
brctl_main                                           974    2339   +1365
show_bridge_timer                                      -      93     +93
static.state_names                                     -      48     +48
printf_xstrtou                                         -      26     +26
packed_usage                                       33243   33253     +10
show_bridge                                          333     323     -10
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 2/1 up/down: 1542/-10)         Total: 1532 bytes
   text	   data	    bss	    dec	    hex	filename
 999868	    551	   5612	1006031	  f59cf	busybox_old
1002309	    551	   5612	1008472	  f6358	busybox_unstripped

Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-11 17:58:15 +02:00
Martin Lewis
6c1af283f7 brctl: add support for showmacs command
function                                             old     new   delta
brctl_main                                           680     974    +294
packed_usage                                       33167   33187     +20
compare_fdbs                                           -      19     +19
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 333/0)             Total: 333 bytes

Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-08 14:43:51 +02:00
Denys Vlasenko
04a0b7f080 bc: placate compiler warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-08 12:58:16 +02:00
Denys Vlasenko
3e463e1cfd brctl: placate compiler warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-08 12:35:06 +02:00
Denys Vlasenko
2945822f86 brctl: add TODO: "showmacs BR"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-04-13 15:48:31 +02:00
Denys Vlasenko
9435608804 brctl: simplify str_to_jiffies()
function                                             old     new   delta
write_uint                                             -      96     +96
brctl_main                                           721     678     -43
write_ulong                                           96       -     -96
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 96/-139)           Total: -43 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-04-13 14:17:55 +02:00
Denys Vlasenko
dc1b2d4356 brctl: convert remaining commands to work via /sys
function                                             old     new   delta
write_ulong                                            -      96     +96
show_bridge                                          310     338     +28
static.ops                                             3       -      -3
arm_ioctl                                             20       -     -20
packed_usage                                       33344   33315     -29
brctl_main                                           885     721    -164
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 1/2 up/down: 124/-216)          Total: -92 bytes
   text	   data	    bss	    dec	    hex	filename
 982112	    485	   7296	 989893	  f1ac5	busybox_old
 982157	    485	   7296	 989938	  f1af2	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-04-13 13:58:06 +02:00
Denys Vlasenko
c5150e9ce7 brctl: make "show" command retrieve data from /sys
ioctl interface is obsolete and has no 32/64 compat shim,
making "brctl show" fail for 32-bit userspace and 64-bit kernel.

function                                             old     new   delta
show_bridge                                            -     310    +310
read_file                                              -      64     +64
if_indextoname                                       117       -    -117
brctl_main                                          1183     885    -298
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 0/1 up/down: 374/-415)          Total: -41 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-04-12 18:52:31 +02:00
Bernhard Reutner-Fischer
7effa31cd4 brctl: use a single buffer for brname and ifname
function                                             old     new   delta
brctl_main                                          1681    1675      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-6)               Total: -6 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2018-10-01 22:45:36 +02:00
Denys Vlasenko
86e07f6893 brctl: make it NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-08-06 20:14:02 +02:00
Denys Vlasenko
72089cf6b4 config: deindent all help texts
Those two spaces after tab have no effect, and always a nuisance when editing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-21 09:50:55 +02:00
Denys Vlasenko
4eed2c6c50 Update menuconfig items with approximate applet sizes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18 22:01:24 +02:00
Denys Vlasenko
47367e1d50 Convert all networking/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23 09:05:14 +01:00
Denys Vlasenko
0f296a3a56 libiproute: rename invarg(a,b) to invarg_1_to_2(a,b)
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>
2015-10-14 13:21:01 +02:00
Denys Vlasenko
d60752f8c9 build system: -fno-builtin-printf
Benefits are: drops reference to out-of-line putchar(), fixes a few cases
of failed string merge.

function                                             old     new   delta
i2cdump_main                                        1488    1502     +14
sha256_process_block64                               423     433     +10
sendmail_main                                       1183    1185      +2
list_table                                          1114    1116      +2
i2cdetect_main                                      1235    1237      +2
fdisk_main                                          2852    2854      +2
builtin_type                                         119     121      +2
unicode_conv_to_printable2                           325     324      -1
scan_recursive                                       380     378      -2
mkfs_minix_main                                     2687    2684      -3
buffer_fill_and_print                                178     169      -9
putchar                                              152       -    -152
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167)          Total: -133 bytes
   text    data     bss     dec     hex filename
 937788     932   17676  956396   e97ec busybox_old
 937564     932   17676  956172   e970c busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-07 22:42:45 +02:00
Denys Vlasenko
5fa6d1a632 Aboriginal linux/musl build fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-05 11:15:43 +02:00
Denys Vlasenko
60cb48ca50 whitespace cleanup. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 15:57:44 +01:00
Nicolas Thill
f47ce07b26 brctl: fix description and usage
brctl uncorrectly displays the "showmacs" command as being supported while
it is not, remove it from the usage and Config.src file.

Signed-off-by: Nicolas Thill <nico@openwrt.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-29 16:43:33 +02:00
Denys Vlasenko
49b8e72012 brctl: fix build failure by s/strtotimeval/bb_strtotimeval/ (android has strtotimeval)
Signed-off-by: Tias Guns <tias@ulyssis.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-10 14:16:16 +02:00
Pere Orga
5bc8c005a8 move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 03:29:49 +02:00
Denys Vlasenko
e4dcba1c10 *: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 18:57:19 +02:00
Denys Vlasenko
0ef64bdb40 *: make GNU licensing statement forms more regular
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>
2010-08-16 20:14:46 +02:00
Denys Vlasenko
7783248eaa *: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_i
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-12 14:14:45 +02:00
Denys Vlasenko
8a659f6ff9 libbb: make index_in_substrings return -1 on ambiguous matches
function                                             old     new   delta
index_in_substrings                                   67      93     +26

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-03 00:52:16 +02:00
Maciek Borzecki
30ebd7bd78 brctl: fixing stp parameters incompatibility
function                                             old     new   delta
static.stp_opts                                        -      23     +23
brctl_main                                          1148    1169     +21
packed_usage                                       26786   26794      +8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 52/0)               Total: 52 bytes

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-23 05:18:38 +01:00
Bernhard Reutner-Fischer
0c0f1767f0 brctl: Fix comment
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-03-17 11:23:04 +01:00
Maciek Borzecki
46abfc0da1 brctl: fix parsing of timespec to allow 0 (setfd, sethello..)
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-17 10:25:29 +01:00
Denis Vlasenko
5e34ff29bc *: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
2009-04-21 11:09:40 +00:00
Denis Vlasenko
802cab15e5 brctl: fix compilation on 2.4.x kernels 2009-01-31 20:08:21 +00:00
Denis Vlasenko
360d9661b6 libbb: add strncpy_IFNAMSIZ
function                                             old     new   delta
...
udhcp_read_interface                                 225     220      -5
brctl_main                                          1151    1146      -5
add_interface                                        109     104      -5
ipaddr_list_or_flush                                2174    2167      -7
do_add_ioctl                                          88      80      -8
vconfig_main                                         249     240      -9
do_del_ioctl                                          78      68     -10
do_iplink                                           1186    1173     -13
do_if_fetch                                          766     753     -13
buffer_fill_and_print                                196     179     -17
parse_args                                          1709    1684     -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/20 up/down: 11/-140)         Total: -129 bytes
2008-12-02 18:18:50 +00:00
Bernhard Reutner-Fischer
6c4dadefb6 - update my name. No obj-code changes ;) 2008-09-25 12:13:34 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
01eaee9309 *: s/IF_NAMESIZE/IFNAMSIZ/, regularize its use a bit.
function                                             old     new   delta
strncpy_IFNAMSIZ                                       -      13     +13
set_slave_mtu                                         39      37      -2
set_slave_hwaddr                                      52      50      -2
set_master_hwaddr                                     52      50      -2
set_if_flags                                          40      38      -2
get_if_settings                                      101      98      -3
ifenslave_main                                      1680    1661     -19
vconfig_main                                         306     280     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/7 up/down: 13/-56)            Total: -43 bytes
2008-04-21 02:21:45 +00:00
Denis Vlasenko
278a1c2264 brctl: optional support for "show" cmd (by L. Gabriel Somlo <somlo AT cmu.edu>)
function                                             old     new   delta
brctl_main                                           739    1186    +447
if_indextoname                                         -     104    +104
static.keywords                                      827     841     +14
static.ops                                             -       7      +7
packed_usage                                       23978   23976      -2
2008-04-06 07:17:02 +00:00
Denis Vlasenko
d0a071a528 brctl: eliminate stray data object
brctl: use constant fd to reduce parameter passing
runsvdir: do not use data/bss
od: reuse bb_argv_dash
last: do not go into endless loop on read error
mount: make it not fail scripts/find_bad_common_bufsiz check
dc: add INIT_G() (no-op for dc, but we want uniform usage of "G trick")

function                                             old     new   delta
runsvdir_main                                       1646    1672     +26
set_pgrp                                               1       -      -1
exitsoon                                               1       -      -1
check                                                679     678      -1
svnum                                                  4       -      -4
svdir                                                  4       -      -4
sv                                                     4       -      -4
stamplog                                               4       -      -4
rploglen                                               4       -      -4
rplog                                                  4       -      -4
mount_main                                           995     988      -7
static.default_file_list                               8       -      -8
pfd                                                    8       -      -8
logpipe                                                8       -      -8
static.info                                           20       -     -20
brctl_main                                           767     739     -28
------------------------------------------------------------------------------
(add/remove: 0/12 grow/shrink: 1/3 up/down: 26/-106)          Total: -80 bytes
   text    data     bss     dec     hex filename
 793327     662    7412  801401   c3a79 busybox_old
 793329     641    7372  801342   c3a3e busybox_unstripped
2008-03-17 09:33:45 +00:00
Bernhard Reutner-Fischer
2b11fb483e - implement brctl setpathcost, setportprio, setbridgeprio, stp
text    data     bss     dec     hex filename
    907      20       0     927     39f networking/brctl.o
2008-01-14 16:10:11 +00:00
Bernhard Reutner-Fischer
1aac3ab49f - shrink a bit and implement time related fancy features. Improve help texts.
text	   data	    bss	    dec	    hex	filename
    253	     20	      0	    273	    111	networking/brctl.o.bare
    613	     20	      0	    633	    279	networking/brctl.o.fancy-time
2008-01-13 18:43:50 +00:00
Bernhard Reutner-Fischer
c44c21060e - save four bytes by manually hoisting the br assignment 2008-01-13 15:43:28 +00:00
Bernhard Reutner-Fischer
d27d925a6d - new applet brctl
text	   data	    bss	    dec	    hex	filename
    289	     20	      0	    309	    135	networking/brctl.o
    335	     23	      0	    358	    166	networking/brctl-verbose-ops.o
2008-01-13 15:23:27 +00:00