oweals/busybox.git
17 years agoifupdown: kill -TERM is default, so drop -TERM
Denis Vlasenko [Tue, 3 Jul 2007 08:26:24 +0000 (08:26 -0000)]
ifupdown: kill -TERM is default, so drop -TERM
ifupdown: ferror() does not set errno, don't use perror
ifupdown: make netmask parsing smaller and more strict
(was accepting 255.0.255.0, 255.1234.0.0 etc...)

function                                             old     new   delta
count_bits                                            36       -     -36
execute                                             2573    2535     -38
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-74)             Total: -74 bytes
   text    data     bss     dec     hex filename
 684204    2744   14000  700948   ab214 busybox_old
 684132    2744   14000  700876   ab1cc busybox_unstripped

17 years agocorrect_password: do not print "no shadow passwd..." message
Denis Vlasenko [Tue, 3 Jul 2007 06:15:42 +0000 (06:15 -0000)]
correct_password: do not print "no shadow passwd..." message

function                                             old     new   delta
correct_password                                     204     191     -13
.rodata                                           129530  129466     -64
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-77)             Total: -77 bytes
   text    data     bss     dec     hex filename
 675984    2744   13968  692696   a91d8 busybox_old
 675908    2744   13968  692620   a918c busybox_unstripped

17 years agoping: fix non-fancy ping6
Denis Vlasenko [Mon, 2 Jul 2007 15:47:52 +0000 (15:47 -0000)]
ping: fix non-fancy ping6

17 years agodevfsd: futher sanitization by Tito <farmatito@tiscali.it>
Denis Vlasenko [Sun, 1 Jul 2007 22:25:33 +0000 (22:25 -0000)]
devfsd: futher sanitization by Tito <farmatito@tiscali.it>

17 years agoexpr: small code shrink
Denis Vlasenko [Sun, 1 Jul 2007 18:33:35 +0000 (18:33 -0000)]
expr: small code shrink

17 years agodevfsd: indentation fixes
Denis Vlasenko [Sun, 1 Jul 2007 18:18:54 +0000 (18:18 -0000)]
devfsd: indentation fixes

17 years agofind: fix build failure on certain configs
Denis Vlasenko [Sun, 1 Jul 2007 17:35:17 +0000 (17:35 -0000)]
find: fix build failure on certain configs
(found by Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>)

17 years agofind: style fix
Denis Vlasenko [Sun, 1 Jul 2007 17:29:44 +0000 (17:29 -0000)]
find: style fix

17 years agops: revert wrong "optimization": (i & 1) -> i
Denis Vlasenko [Sun, 1 Jul 2007 17:25:59 +0000 (17:25 -0000)]
ps: revert wrong "optimization": (i & 1) -> i

17 years agofix comment placement (no code changes)
Denis Vlasenko [Sun, 1 Jul 2007 17:11:54 +0000 (17:11 -0000)]
fix comment placement (no code changes)

17 years agoudhcp: new config option "Rewrite the lease file at every new acknowledge"
Denis Vlasenko [Sun, 1 Jul 2007 17:05:57 +0000 (17:05 -0000)]
udhcp: new config option "Rewrite the lease file at every new acknowledge"
       (Mats Erik Andersson <mats@blue2net.com> (Blue2Net AB))
udhcp: consistently treat server_config.start/end IPs as host-order
       fix IP parsing for 64bit machines
       fix unsafe hton macro usage in read_opt()
       do not chdir("/") when daemonizing
       fix help text

17 years agops: fix "unused variable" warning; fix integer variable declared as char.
Denis Vlasenko [Sun, 1 Jul 2007 14:53:06 +0000 (14:53 -0000)]
ps: fix "unused variable" warning; fix integer variable declared as char.

17 years agoweb site: announce 1.6.1
Denis Vlasenko [Sat, 30 Jun 2007 17:12:14 +0000 (17:12 -0000)]
web site: announce 1.6.1

17 years agotop,ps: improve /proc/PID/cmdinfo reading code
Denis Vlasenko [Sat, 30 Jun 2007 14:47:41 +0000 (14:47 -0000)]
top,ps: improve /proc/PID/cmdinfo reading code

function                                             old     new   delta
display_status                                         -    1231   +1231
read_cmdline                                           -     101    +101
parse_conf                                          1284    1303     +19
arith                                               2033    2042      +9
collect_blk                                          467     474      +7
fsck_main                                           1909    1911      +2
dhcprelay_main                                      1125    1122      -3
singlemount                                         4555    4547      -8
read_close                                            50      36     -14
get_lcm                                              123     105     -18
ed_main                                             3111    3084     -27
func_args                                             73      28     -45
procps_scan                                          732     658     -74
top_main                                            2187     899   -1288
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 4/8 up/down: 1369/-1477)       Total: -108 bytes
   text    data     bss     dec     hex filename
 676048    2744   13968  692760   a9218 busybox_old
 675940    2744   13968  692652   a91ac busybox_unstripped

17 years agoadd bb_basename.c
Denis Vlasenko [Sat, 30 Jun 2007 10:58:08 +0000 (10:58 -0000)]
add bb_basename.c

17 years agointroduce and use bb_basename()
Denis Vlasenko [Sat, 30 Jun 2007 08:04:05 +0000 (08:04 -0000)]
introduce and use bb_basename()

function                                             old     new   delta
bb_basename                                            -      26     +26
sv_main                                             1226    1225      -1
passwd_main                                         1985    1983      -2
showdirs                                             482     478      -4
sendCgi                                             1811    1807      -4
make_device                                         1354    1350      -4
handleIncoming                                      2443    2439      -4
func_name                                             82      78      -4
service_name                                        2292    2285      -7
main                                                 909     901      -8
cmp_main                                             555     547      -8
test_main                                            434     422     -12
act                                                  228     216     -12
find_pair                                            180     164     -16
rmmod_main                                           298     280     -18
find_pid_by_name                                     156     134     -22
modprobe_main                                       1606    1576     -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/16 up/down: 26/-156)         Total: -130 bytes
   text    data     bss     dec     hex filename
 734933    3028   14400  752361   b7ae9 busybox_old
 734801    3028   14400  752229   b7a65 busybox_unstripped

17 years agokillall, pidof: use argv0 for process matching too
Denis Vlasenko [Sat, 30 Jun 2007 08:03:26 +0000 (08:03 -0000)]
killall, pidof: use argv0 for process matching too
top: show cmdline, not comm field
(fixes problems with re-execed applets showing as processes with name "exe",
and not being found by pidof/killall by applet name)

function                                             old     new   delta
find_pid_by_name                                      98     156     +58
procps_scan                                          692     732     +40
top_main                                            2724    2762     +38
find_pair                                            164     180     +16
collect_int                                          114     123      +9
cmp_main                                             547     555      +8
collect_fork                                         112     119      +7
collect_ctx                                          112     119      +7
read_package_field                                   253     257      +4
passwd_main                                         1983    1985      +2
process_stdin                                        435     433      -2
xstrtoul_range_sfx                                   229     226      -3
get_next_block                                      1852    1849      -3
arith                                               2042    2033      -9
sv_main                                             1236    1226     -10
singlemount                                         4690    4672     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 10/6 up/down: 189/-45)          Total: 144 bytes
   text    data     bss     dec     hex filename
 734789    3028   14400  752217   b7a59 busybox_old
 734933    3028   14400  752361   b7ae9 busybox_unstripped

17 years agoprocps: shrink /proc scanning code a bit
Denis Vlasenko [Sat, 30 Jun 2007 08:01:04 +0000 (08:01 -0000)]
procps: shrink /proc scanning code a bit

function                                             old     new   delta
skip_fields                                           16      15      -1
.rodata                                           144266  144258      -8
procps_scan                                          739     692     -47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-56)             Total: -56 bytes
   text    data     bss     dec     hex filename
 734845    3028   14400  752273   b7a91 busybox_old
 734789    3028   14400  752217   b7a59 busybox_unstripped

17 years agodocument firmware support
Mike Frysinger [Thu, 28 Jun 2007 17:13:51 +0000 (17:13 -0000)]
document firmware support

17 years agowget: fix bug in base64 encoding (bug 1404). +10 bytes.
Denis Vlasenko [Wed, 27 Jun 2007 21:40:07 +0000 (21:40 -0000)]
wget: fix bug in base64 encoding (bug 1404). +10 bytes.

17 years agodevfsd: style cleanup; size reduction (Tito <farmatito@tiscali.it>)
Denis Vlasenko [Wed, 27 Jun 2007 00:20:38 +0000 (00:20 -0000)]
devfsd: style cleanup; size reduction (Tito <farmatito@tiscali.it>)
traceroute: suppress warning

17 years agouuencode: shrink
Denis Vlasenko [Tue, 26 Jun 2007 15:59:37 +0000 (15:59 -0000)]
uuencode: shrink

function                                             old     new   delta
uuencode_main                                        427     337     -90
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-90)             Total: -90 bytes
   text    data     bss     dec     hex filename
 734981    3028   14400  752409   b7b19 busybox_old
 734889    3028   14400  752317   b7abd busybox_unstripped

17 years agodevfsd: fix formatting (Tito <farmatito@tiscali.it>)
Denis Vlasenko [Mon, 25 Jun 2007 22:55:34 +0000 (22:55 -0000)]
devfsd: fix formatting (Tito <farmatito@tiscali.it>)
ash: fix SEGV if type has zero parameters

17 years agoConsolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms...
Denis Vlasenko [Mon, 25 Jun 2007 10:55:35 +0000 (10:55 -0000)]
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)

17 years ago- need to pass the PATH down to the gcc-version check to be able to find the correct cc.
Bernhard Reutner-Fischer [Mon, 25 Jun 2007 10:41:01 +0000 (10:41 -0000)]
- need to pass the PATH down to the gcc-version check to be able to find the correct cc.
  Fixes make PATH="$CROSS_BIN:$PATH" CROSS_COMPILE=foo- like invocations that previously failed to resolve since the information about the path set by the user was lost.

17 years agotest: suppress gcc warning
Denis Vlasenko [Mon, 25 Jun 2007 10:35:11 +0000 (10:35 -0000)]
test: suppress gcc warning
telnetd: do not use suferfluous static variable.

17 years agohttpd: NOMMU fixes by Alex Landau <landau_alex@yahoo.com>
Denis Vlasenko [Sat, 23 Jun 2007 23:14:02 +0000 (23:14 -0000)]
httpd: NOMMU fixes by Alex Landau <landau_alex@yahoo.com>

17 years agopidof: size optimizations (-50 bytes)
Denis Vlasenko [Sat, 23 Jun 2007 14:56:43 +0000 (14:56 -0000)]
pidof: size optimizations (-50 bytes)

17 years ago- handy to have the cross_compile block here, too
Bernhard Reutner-Fischer [Fri, 22 Jun 2007 17:39:21 +0000 (17:39 -0000)]
- handy to have the cross_compile block here, too

17 years agosyslogd: do not convert tabs to ^I
Denis Vlasenko [Thu, 21 Jun 2007 13:44:53 +0000 (13:44 -0000)]
syslogd: do not convert tabs to ^I

17 years agotest: shrink a bit
Denis Vlasenko [Thu, 21 Jun 2007 13:35:52 +0000 (13:35 -0000)]
test: shrink a bit

function                                             old     new   delta
test_main                                              5     434    +429
bb_test                                              473       -    -473
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 429/-473)          Total: -44 bytes
   text    data     bss     dec     hex filename
 735073    3028   14408  752509   b7b7d busybox_old
 735029    3028   14408  752465   b7b51 busybox_unstripped

17 years agobuild system: remove kernel .config locations (spotted by walter harms <wharms@bfs...
Denis Vlasenko [Thu, 21 Jun 2007 12:57:29 +0000 (12:57 -0000)]
build system: remove kernel .config locations (spotted by walter harms <wharms@bfs.de>)

17 years agorandom shrinkage of statics, -60 bytes saved
Denis Vlasenko [Thu, 21 Jun 2007 12:43:45 +0000 (12:43 -0000)]
random shrinkage of statics, -60 bytes saved

17 years agotar: improve OLDGNU compat, make old SUN compat configurable
Denis Vlasenko [Thu, 21 Jun 2007 12:41:59 +0000 (12:41 -0000)]
tar: improve OLDGNU compat, make old SUN compat configurable

17 years ago- add ATTRIBUTE_UNUSED_RESULT for internal use
Bernhard Reutner-Fischer [Thu, 21 Jun 2007 10:39:20 +0000 (10:39 -0000)]
- add ATTRIBUTE_UNUSED_RESULT for internal use

17 years agosince we removed the deprecated matches() now and thus not alot of warnings are curre...
Bernhard Reutner-Fischer [Thu, 21 Jun 2007 10:28:11 +0000 (10:28 -0000)]
since we removed the deprecated matches() now and thus not alot of warnings are currently seen, let's strive to fixup these:
- warn a little bit about unused results

17 years ago- remove matches() from networking/. Untested.
Bernhard Reutner-Fischer [Thu, 21 Jun 2007 10:20:13 +0000 (10:20 -0000)]
- remove matches() from networking/. Untested.
   text    data     bss     dec     hex filename
   1705       0       0    1705     6a9 networking/libiproute/utils.o.orig
   1676       0       0    1676     68c networking/libiproute/utils.o
    766       0       0     766     2fe networking/libiproute/rtm_map.o.orig
    670       0       0     670     29e networking/libiproute/rtm_map.o
   4942       0       0    4942    134e networking/libiproute/iptunnel.o.orig
   4687       0       0    4687    124f networking/libiproute/iptunnel.o

17 years agoslattach: code shrink (Bernhard Fischer <rep.dot.nop@gmail.com>)
Denis Vlasenko [Thu, 21 Jun 2007 07:27:43 +0000 (07:27 -0000)]
slattach: code shrink (Bernhard Fischer <rep.dot.nop@gmail.com>)

17 years agoremove extra ')'
Denis Vlasenko [Thu, 21 Jun 2007 07:09:18 +0000 (07:09 -0000)]
remove extra ')'

17 years agoslattach: new applet.
Denis Vlasenko [Wed, 20 Jun 2007 15:23:03 +0000 (15:23 -0000)]
slattach: new applet.

17 years ago- move iprule and ipaddress from matches() to index_in_str_array
Bernhard Reutner-Fischer [Wed, 20 Jun 2007 14:53:49 +0000 (14:53 -0000)]
- move iprule and ipaddress from matches() to index_in_str_array
   text    data     bss     dec     hex filename
   2544       0       0    2544     9f0 networking/libiproute/iprule.o.oorig
   2356       0       0    2356     934 networking/libiproute/iprule.o
   6481       0       0    6481    1951 networking/libiproute/ipaddress.o.oorig
   6464       0       0    6464    1940 networking/libiproute/ipaddress.o

17 years agodo not do utime() on links, it acts on link targets, and we don't want that.
Denis Vlasenko [Wed, 20 Jun 2007 14:49:47 +0000 (14:49 -0000)]
do not do utime() on links, it acts on link targets, and we don't want that.
rename link_name to link_target, less confusing this way.

17 years ago- remove another user of the deprecated matches() func by moving it to use index_in_s...
Bernhard Reutner-Fischer [Wed, 20 Jun 2007 12:42:03 +0000 (12:42 -0000)]
- remove another user of the deprecated matches() func by moving it to use index_in_str_array. Untested.
   text    data     bss     dec     hex filename
    445       0       4     449     1c1 ip_parse_common_args.o.oorig
    391       0       4     395     18b ip_parse_common_args.o

17 years ago- do not hardcode HOSTCFLAGS to gcc specific flags. Fixes errors when not using gcc...
Bernhard Reutner-Fischer [Wed, 20 Jun 2007 10:01:12 +0000 (10:01 -0000)]
- do not hardcode HOSTCFLAGS to gcc specific flags. Fixes errors when not using gcc as HOSTCC

17 years ago- strndupa is a GNU extension. Using strdup to avoid several errors like:
Bernhard Reutner-Fischer [Wed, 20 Jun 2007 09:56:47 +0000 (09:56 -0000)]
- strndupa is a GNU extension. Using strdup to avoid several errors like:
  util-linux/mdev.c:(.text+0x29a): undefined reference to `strndupa'

17 years agoecho: fix yet another buglet in non-fancy echo
Denis Vlasenko [Tue, 19 Jun 2007 23:04:17 +0000 (23:04 -0000)]
echo: fix yet another buglet in non-fancy echo

17 years agoping: fix incorrect handling of -I (Iouri Kharon <bc-info@styx.cabel.net>)
Denis Vlasenko [Tue, 19 Jun 2007 22:54:21 +0000 (22:54 -0000)]
ping: fix incorrect handling of -I (Iouri Kharon <bc-info@styx.cabel.net>)

17 years agofind: -context support for SELinux (KaiGai Kohei <kaigai@kaigai.gr.jp>)
Denis Vlasenko [Tue, 19 Jun 2007 22:22:57 +0000 (22:22 -0000)]
find: -context support for SELinux (KaiGai Kohei <kaigai@kaigai.gr.jp>)
find: make it a bit smaller

function                                             old     new   delta
.rodata                                           129018  129050     +32
parse_params                                        1509    1346    -163
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 32/-163)          Total: -131 bytes

17 years agopscan: size optimization (Tito <farmatito@tiscali.it>)
Denis Vlasenko [Tue, 19 Jun 2007 16:57:47 +0000 (16:57 -0000)]
pscan: size optimization (Tito <farmatito@tiscali.it>)

17 years agopunt %.bflt target in favor of proper LDFLAGS=-Wl,-elf2flt handling
Mike Frysinger [Tue, 19 Jun 2007 15:58:02 +0000 (15:58 -0000)]
punt %.bflt target in favor of proper LDFLAGS=-Wl,-elf2flt handling

17 years agotop,ps: 'stringify' tty only when needed. -60 bytes.
Denis Vlasenko [Tue, 19 Jun 2007 14:43:17 +0000 (14:43 -0000)]
top,ps: 'stringify' tty only when needed. -60 bytes.

17 years agotop: speedup if tty info is not requested
Denis Vlasenko [Tue, 19 Jun 2007 13:53:12 +0000 (13:53 -0000)]
top: speedup if tty info is not requested

17 years agotop,ps: reduce CPU usage in decimal conversion (optional)
Denis Vlasenko [Tue, 19 Jun 2007 13:46:24 +0000 (13:46 -0000)]
top,ps: reduce CPU usage in decimal conversion (optional)

   text    data     bss     dec     hex filename
 734651    3040   14416  752107   b79eb busybox_old
 734751    3040   14416  752207   b7a4f busybox_unstripped

17 years agoll_map: disable interface name caching code
Denis Vlasenko [Tue, 19 Jun 2007 12:11:20 +0000 (12:11 -0000)]
ll_map: disable interface name caching code

function                                             old     new   delta
find_by_index                                          -      26     +26
static.icache                                          4       -      -4
ll_idx_n2a                                            71      59     -12
static.ncache                                         16       -     -16
ll_index_to_flags                                     40      24     -16
xll_name_to_index                                    206     104    -102
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 0/3 up/down: 26/-150)          Total: -124 bytes

   text    data     bss     dec     hex filename
 734703    3040   14440  752183   b7a37 busybox_old
 734599    3040   14416  752055   b79b7 busybox_unstripped

17 years agodefconfig: update
Denis Vlasenko [Tue, 19 Jun 2007 11:33:48 +0000 (11:33 -0000)]
defconfig: update

17 years agomake /etc/network parsing configurable. -200 bytes when off.
Denis Vlasenko [Tue, 19 Jun 2007 11:24:47 +0000 (11:24 -0000)]
make /etc/network parsing configurable. -200 bytes when off.

17 years agonetworking/interface.c: huke remaining big statics; use malloc for INET[6]_rresolve
Denis Vlasenko [Tue, 19 Jun 2007 11:12:46 +0000 (11:12 -0000)]
networking/interface.c: huke remaining big statics; use malloc for INET[6]_rresolve
return value. Went thru callers and adjusted them - code got smaller too.

function                                             old     new   delta
ip_port_str                                            -     126    +126
INET6_rresolve                                       165     182     +17
static.cache                                          20      24      +4
route_main                                          2092    2091      -1
INET_sprint                                           61      59      -2
INET_nn                                                4       -      -4
INET6_sprint                                          59      53      -6
udp_do_one                                           518     508     -10
tcp_do_one                                           433     423     -10
raw_do_one                                           494     484     -10
traceroute_main                                     4117    4105     -12
INET_rresolve                                        334     321     -13
bb_displayroutes                                     494     456     -38
snprint_ip_port                                      244       -    -244
static.buff                                          264      16    -248
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/10 up/down: 147/-598)        Total: -451 bytes

size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 751073    3048   14688  768809   bbb29 busybox_old
 750873    3048   14440  768361   bb969 busybox_unstripped

17 years agonetworking/interface.c: reduce bss usage
Denis Vlasenko [Tue, 19 Jun 2007 11:10:02 +0000 (11:10 -0000)]
networking/interface.c: reduce bss usage

function                                             old     new   delta
.rodata                                           158918  158950     +32
display_interfaces                                   133     153     +20
UNSPEC_print                                          56      68     +12
pr_ether                                              59      65      +6
static.proc_read                                       4       1      -3
interface_opt_a                                        4       1      -3
in_ether                                             139     136      -3
ifconfig_main                                       1296    1293      -3
if_readlist_proc                                     686     680      -6
ife_print                                           1350    1338     -12
do_if_print                                           46       -     -46
static.buff                                          369     264    -105
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 4/7 up/down: 70/-181)          Total: -111 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 751073    3080   14800  768953   bbbb9 busybox_old
 751073    3048   14688  768809   bbb29 busybox_unstripped

17 years agolibbb: random hunt for statics
Denis Vlasenko [Mon, 18 Jun 2007 10:35:06 +0000 (10:35 -0000)]
libbb: random hunt for statics

function                                             old     new   delta
bb_askpass                                           306     321     +15
pw_encrypt                                            38      39      +1
static.passwd                                         64       4     -60
static.cipher                                        128       4    -124
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 16/-184)          Total: -168 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 683705    2704   14240  700649   ab0e9 busybox_old
 683721    2704   14064  700489   ab049 busybox_unstripped

17 years agolibpwdgrp/pwd_grp.c: allocate local storage on first call, not in bss. -1k bss
Denis Vlasenko [Mon, 18 Jun 2007 10:08:27 +0000 (10:08 -0000)]
libpwdgrp/pwd_grp.c: allocate local storage on first call, not in bss. -1k bss

function                                             old     new   delta
get_S                                                  -      31     +31
bb_internal_getpwnam                                  38      44      +6
bb_internal_getgrnam                                  38      44      +6
bb_internal_getgrgid                                  38      44      +6
ptr_to_statics                                         -       4      +4
static.resultbuf                                      88       -     -88
static.buffer                                       1024       -   -1024
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 3/0 up/down: 53/-1112)        Total: -1059 bytes

17 years agoping: fix write-after-allocated-mem bug
Denis Vlasenko [Mon, 18 Jun 2007 08:55:57 +0000 (08:55 -0000)]
ping: fix write-after-allocated-mem bug
ping: use monotonic_us instead of gettimeofday: smaller code and
      needs only 4 bytes in the packet
ping: display roundtrip times with 1/1000th of ms, not 1/10 ms precision.
wget: small optimization

function                                             old     new   delta
pingstats                                            243     259     +16
sendping6                                             98      93      -5
sendping4                                            183     178      -5
.rodata                                           129715  129707      -8
progressmeter                                        867     855     -12
unpack_tail                                          320     272     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/5 up/down: 16/-78)            Total: -62 bytes

17 years agofix an obvious typo while trying to access the tv_usec member
Mike Frysinger [Mon, 18 Jun 2007 07:12:31 +0000 (07:12 -0000)]
fix an obvious typo while trying to access the tv_usec member

17 years agowget: use monotonic_sec instead of gettimeofday
Denis Vlasenko [Sun, 17 Jun 2007 23:40:26 +0000 (23:40 -0000)]
wget: use monotonic_sec instead of gettimeofday
zcip: use monotonic_us instead of gettimeofday
udhcpcd: simpler, shorter random_xid()

function                                             old     new   delta
monotonic_sec                                          -      41     +41
find_pair                                            164     180     +16
run_list_real                                       2018    2028     +10
cmp_main                                             547     555      +8
collect_ctx                                          112     119      +7
singlemount                                         4544    4549      +5
time_main                                           1124    1128      +4
static.start_sec                                       -       4      +4
static.lastupdate_sec                                  -       4      +4
sock                                                   -       4      +4
read_package_field                                   253     257      +4
pick                                                  38      40      +2
get_next_line                                        145     147      +2
count_lines                                           59      61      +2
process_stdin                                        435     433      -2
xstrtoul_range_sfx                                   229     226      -3
static.initialized                                     4       1      -3
dhcprelay_main                                      1125    1122      -3
catcher                                              380     377      -3
arping_main                                         1969    1966      -3
s                                                      8       4      -4
cfg                                                    4       -      -4
static.lastupdate                                      8       -      -8
start                                                  8       -      -8
random_xid                                            95      33     -62
.rodata                                           129114  129050     -64
zcip_main                                           1731    1576    -155
progressmeter                                       1035     867    -168
------------------------------------------------------------------------------
(add/remove: 4/3 grow/shrink: 10/11 up/down: 113/-490)       Total: -377 bytes

17 years agohwclock: size optimizations
Denis Vlasenko [Sun, 17 Jun 2007 19:09:05 +0000 (19:09 -0000)]
hwclock: size optimizations
libbb/time.c: new file, introducing monotonic_us()
pscan, traceroute, arping: use it instead of gettimeofday
ping, zcip: TODO

function                                             old     new   delta
monotonic_us                                           -      89     +89
find_pair                                            164     180     +16
.rodata                                           129747  129763     +16
refresh                                             1144    1152      +8
............
timeout                                                8       4      -4
static.start                                           8       4      -4
last                                                   8       4      -4
parse_conf                                          1303    1284     -19
time_main                                           1149    1124     -25
gettimeofday_us                                       39       -     -39
arping_main                                         2042    1969     -73
hwclock_main                                         594     501     -93
catcher                                              485     380    -105
traceroute_main                                     4300    4117    -183
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 8/11 up/down: 157/-562)        Total: -405 bytes

17 years agotime: *const str = "xxx" ==> str[] = "xxx"
Denis Vlasenko [Sun, 17 Jun 2007 19:04:58 +0000 (19:04 -0000)]
time: *const str = "xxx"  ==>  str[] = "xxx"

17 years agostrings: strings a b was processing a twice, fix that
Denis Vlasenko [Sun, 17 Jun 2007 12:19:07 +0000 (12:19 -0000)]
strings: strings a b was processing a twice, fix that

17 years agoarping: -i should be -I
Denis Vlasenko [Sun, 17 Jun 2007 00:36:57 +0000 (00:36 -0000)]
arping: -i should be -I

17 years agoinstall: fix install a b /a/link/to/dir
Denis Vlasenko [Sun, 17 Jun 2007 00:35:15 +0000 (00:35 -0000)]
install: fix install a b /a/link/to/dir
install: fix -s (strip) option
nmeter: add TODO

17 years agoforgot svn add...
Denis Vlasenko [Sat, 16 Jun 2007 20:52:33 +0000 (20:52 -0000)]
forgot svn add...

17 years agoremove obsolete comment
Denis Vlasenko [Sat, 16 Jun 2007 14:16:30 +0000 (14:16 -0000)]
remove obsolete comment

17 years agomake FEATURE_HAVE_RPC auto-selectable by mount and inetd sub-features
Denis Vlasenko [Sat, 16 Jun 2007 13:56:51 +0000 (13:56 -0000)]
make FEATURE_HAVE_RPC auto-selectable by mount and inetd sub-features

17 years agopscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
Denis Vlasenko [Sat, 16 Jun 2007 13:37:59 +0000 (13:37 -0000)]
pscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
wget: lift 256 chars limitation on terminal width

17 years agofind: make -size match GNU find
Denis Vlasenko [Sat, 16 Jun 2007 00:30:52 +0000 (00:30 -0000)]
find: make -size match GNU find

17 years agofind: add conditional support for -maxdepth and -regex
Denis Vlasenko [Fri, 15 Jun 2007 23:43:11 +0000 (23:43 -0000)]
find: add conditional support for -maxdepth and -regex
(needed for Linux 2.6.22-rc4 build)

-maxdepth:
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 675622    2792   15728  694142   a977e busybox_old
 675770    2792   15728  694290   a9812 busybox_unstripped

-regex:
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 675770    2792   15728  694290   a9812 busybox_old
 675894    2792   15728  694414   a988e busybox_unstripped

17 years agofdisk: fix minor issues with help text
Denis Vlasenko [Fri, 15 Jun 2007 21:17:21 +0000 (21:17 -0000)]
fdisk: fix minor issues with help text

17 years ago- fix test -f ./exists
Bernhard Reutner-Fischer [Fri, 15 Jun 2007 10:36:49 +0000 (10:36 -0000)]
- fix test -f ./exists
  Note that test -f ./exists -a "-u" = "-u" doesn't work and did not work even before r18282, so this is a breakage not caused by me..

17 years ago- vda perfers not to use the banner
Bernhard Reutner-Fischer [Fri, 15 Jun 2007 08:30:33 +0000 (08:30 -0000)]
- vda perfers not to use the banner

17 years agoapplets/Kbuild: straighten it a bit
Denis Vlasenko [Thu, 14 Jun 2007 21:41:15 +0000 (21:41 -0000)]
applets/Kbuild: straighten it a bit

17 years agoAlex Landau writes: open firmware for reading, not writing
Mike Frysinger [Thu, 14 Jun 2007 09:29:48 +0000 (09:29 -0000)]
Alex Landau writes: open firmware for reading, not writing

17 years agoinit: make sure fd 0,1,2 are not closed, + related optimizations.
Denis Vlasenko [Thu, 14 Jun 2007 07:53:06 +0000 (07:53 -0000)]
init: make sure fd 0,1,2 are not closed, + related optimizations.

init_main                                            929     920      -9
bb_daemonize_or_rexec                                145     127     -18

17 years agotraceroute: stop using floating point needlessly; nuke useless assignment.
Denis Vlasenko [Thu, 14 Jun 2007 07:47:52 +0000 (07:47 -0000)]
traceroute: stop using floating point needlessly; nuke useless assignment.

.rodata                                           129308  129312      +4
freehostinfo                                          35      29      -6
traceroute_main                                     4308    4300      -8

17 years agominix.h: add very simple test script
Denis Vlasenko [Wed, 13 Jun 2007 12:49:46 +0000 (12:49 -0000)]
minix.h: add very simple test script

17 years agofsck_minix: forgotten bit of previous commit...
Denis Vlasenko [Wed, 13 Jun 2007 12:35:34 +0000 (12:35 -0000)]
fsck_minix: forgotten bit of previous commit...

17 years agofsck_minix: stop using data/bss
Denis Vlasenko [Wed, 13 Jun 2007 12:28:21 +0000 (12:28 -0000)]
fsck_minix: stop using data/bss

  10847       8     271   11126    2b76 busybox.t2/util-linux/fsck_minix.o
  10140       0       0   10140    279c busybox.t3/util-linux/fsck_minix.o

17 years ago*: BB_BANNER -> bb_banner (it is not a const or #define)!
Denis Vlasenko [Wed, 13 Jun 2007 12:27:17 +0000 (12:27 -0000)]
*: BB_BANNER -> bb_banner (it is not a const or #define)!
correct_password: explain in detail why it is ok to use bb_banner
fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one

Marginal size difference:
   text    data     bss     dec     hex filename
 679119    2700   15632  697451   aa46b busybox_old
 679091    2700   15632  697423   aa44f busybox_unstripped

17 years agoas suggested by Renaud Cerrato and Souf, switch over to recursive_action() for some...
Mike Frysinger [Wed, 13 Jun 2007 09:24:50 +0000 (09:24 -0000)]
as suggested by Renaud Cerrato and Souf, switch over to recursive_action() for some nice shrinkage and so we work even when CONFIG_SYSFS_DEPRECATED is off

17 years agoadd support for firmware loading
Mike Frysinger [Wed, 13 Jun 2007 07:34:15 +0000 (07:34 -0000)]
add support for firmware loading

17 years agohush: fix read builtin to not read ahead past eol and to not use
Denis Vlasenko [Wed, 13 Jun 2007 06:47:47 +0000 (06:47 -0000)]
hush: fix read builtin to not read ahead past eol and to not use
insane amounts of stack. Testsuite updated.

17 years agoremove nearly-duplicate PATHs in several places
Denis Vlasenko [Tue, 12 Jun 2007 22:35:19 +0000 (22:35 -0000)]
remove nearly-duplicate PATHs in several places

function                                             old     new   delta
bb_PATH_root_path                                      -      35     +35
varunset                                              60      58      -2
arith                                               2042    2033      -9
bb_default_root_login_path                            30       -     -30
.rodata                                           128794  128762     -32
which_main                                           152     117     -35
defpathvar                                            40       -     -40
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 0/4 up/down: 35/-148)          Total: -113 bytes

17 years agologin: make /etc/nologin support configurable. -240 bytes if not selected.
Denis Vlasenko [Tue, 12 Jun 2007 22:04:57 +0000 (22:04 -0000)]
login: make /etc/nologin support configurable. -240 bytes if not selected.

17 years agofix "--help prints usage for wrong applet" bug
Denis Vlasenko [Tue, 12 Jun 2007 20:55:38 +0000 (20:55 -0000)]
fix "--help prints usage for wrong applet" bug

17 years agodiff: shrink code (-85 bytes):
Denis Vlasenko [Tue, 12 Jun 2007 20:54:54 +0000 (20:54 -0000)]
diff: shrink code (-85 bytes):
function                                             old     new   delta
fiddle_sum                                             8       -      -8
diffreg                                             2717    2690     -27
prepare                                              334     284     -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-85)             Total: -85 bytes

s/ATTRIBUTE_ALWAYS_INLINE/ALWAYS_INLINE/g

17 years ago- fix testing primary expressions like '"-u" = "-u"'
Bernhard Reutner-Fischer [Tue, 12 Jun 2007 13:21:08 +0000 (13:21 -0000)]
- fix testing primary expressions like '"-u" = "-u"'

17 years agoA few more string duplicates found & eliminated
Denis Vlasenko [Tue, 12 Jun 2007 08:52:02 +0000 (08:52 -0000)]
A few more string duplicates found & eliminated

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 679693    2700   15632  698025   aa6a9 busybox_old
 679523    2700   15632  697855   aa5ff busybox_unstripped

17 years agocatv: was abusing xopen, should not die on err, but warn only.
Denis Vlasenko [Tue, 12 Jun 2007 08:13:34 +0000 (08:13 -0000)]
catv: was abusing xopen, should not die on err, but warn only.

17 years agomove several applets to more correct ex-project. No code changes.
Denis Vlasenko [Tue, 12 Jun 2007 08:12:33 +0000 (08:12 -0000)]
move several applets to more correct ex-project. No code changes.

17 years agouudecode: nuke duplicate base64_table[]. saves 65 bytes
Denis Vlasenko [Tue, 12 Jun 2007 07:24:11 +0000 (07:24 -0000)]
uudecode: nuke duplicate base64_table[]. saves 65 bytes

17 years agotop: on user suggestion make percentile calculations configurable. -56 bytes when...
Denis Vlasenko [Mon, 11 Jun 2007 16:31:55 +0000 (16:31 -0000)]
top: on user suggestion make percentile calculations configurable. -56 bytes when off. +600 bytes when on
top: reorder columns, so that [P]PIDs are together and VSZ/%MEM are together. Makes more sense

17 years ago- use bb_msg_full_version instead of a separate string. Saves a minor 3 bytes.
Bernhard Reutner-Fischer [Mon, 11 Jun 2007 15:09:21 +0000 (15:09 -0000)]
- use bb_msg_full_version instead of a separate string. Saves a minor 3 bytes.

17 years agogetopt_mk_fifo_nod: heed warning
Denis Vlasenko [Sun, 10 Jun 2007 19:29:37 +0000 (19:29 -0000)]
getopt_mk_fifo_nod: heed warning