Commit Graph

404 Commits

Author SHA1 Message Date
Denis Vlasenko
f20de5bb42 ash,kill: use common code for kill applet/builtin
# make bloatcheck
function                                             old     new   delta
evaltreenr                                           644     654     +10
evaltree                                             644     654     +10
parse_conf                                          1440    1444      +4
dpkg_deb_main                                        426     429      +3
ed_main                                             3319    3321      +2
passwd_main                                         2093    2091      -2
kill_main                                            830     826      -4
singlemount                                         4609    4601      -8
find_command                                         962     954      -8
get_lcm                                              123     105     -18
.rodata                                           132243  132147     -96
killcmd                                              449     120    -329
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/7 up/down: 29/-465)          Total: -436 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 723901    2940   27504  754345   b82a9 busybox_old
 723457    2940   27504  753901   b80ed busybox_unstripped
2007-04-29 23:42:54 +00:00
Denis Vlasenko
18e19f2b0d hush: fix nofork + ctrl-Z clobbering of globals 2007-04-28 16:43:18 +00:00
Denis Vlasenko
8581863a1b procps: remove all global variables
text    data     bss     dec     hex filename
   1462      14      24    1500     5dc busybox.t2/procps/ps.o
   1484       0       0    1484     5cc busybox.t3/procps/ps.o
   3122       0     252    3374     d2e busybox.t1/procps/top.o
   3117       0       0    3117     c2d busybox.t3/procps/top.o
2007-04-19 14:47:11 +00:00
Denis Vlasenko
516a0ca2dc ps: add -o tty and -o rss support
1373      14      24    1411     583 busybox.t1/procps/ps.o
   1462      14      24    1500     5dc busybox.t2/procps/ps.o
2007-04-19 14:46:14 +00:00
Denis Vlasenko
f5294e1f4c hush: use NOFORK applets as appropriate. Net reduction of code size. 2007-04-14 10:09:57 +00:00
Denis Vlasenko
16abcd90ae teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
2007-04-13 23:59:52 +00:00
Bernhard Reutner-Fischer
b290889f02 - add xsendto and use where appropriate; shrink iplink; sanitize libiproute a bit.
-916 byte
2007-04-12 11:34:39 +00:00
Denis Vlasenko
50f7f446ec bb_full_fd_action: remove potential xmalloc from NOFORK path
cat: stop using stdio.h opens
libbb: introduce & use open[3]_or_warn
function                                             old     new   delta
open3_or_warn                                          -      54     +54
bb_cat                                               115     144     +29
open_or_warn                                           -      25     +25
unlzma                                              2404    2412      +8
chattr_main                                          334     339      +5
xstrtoul_range_sfx                                   251     255      +4
telnet_main                                         1514    1510      -4
static.opt                                             4       -      -4
qgravechar                                           122     118      -4
fuser_add_pid                                         61      54      -7
fuser_add_inode                                      154     147      -7
writeFileToTarball                                  1542    1534      -8
refresh                                             1156    1148      -8
do_show                                              856     846     -10
read_leases                                          212     200     -12
setup_redirects                                      236     222     -14
iproute_list_or_flush                               1582    1568     -14
read_config                                          427     411     -16
write_leases                                         284     264     -20
hash_file                                            338     318     -20
copy_file                                           1760    1740     -20
do_iproute                                          2610    2588     -22
bb_full_fd_action                                    320     269     -51
open_to_or_warn                                      103      49     -54
fuser_main                                          1660    1596     -64
.rodata                                           131160  131096     -64
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423)        Total: -298 bytes
2007-04-11 23:20:53 +00:00
Denis Vlasenko
e4f2d064b0 rename: run_applet_by_name -> run_applet_and_exit 2007-04-11 17:03:19 +00:00
Denis Vlasenko
473dae080a add more convenient defines for [NO]MMU:
"#ifndef BB_NOMMU" is a double negative
2007-04-11 07:04:23 +00:00
Denis Vlasenko
80d14beae9 Rename two config options:
FEATURE_SH_STANDALONE_SHELL => FEATURE_SH_STANDALONE
FEATURE_EXEC_PREFER_APPLETS => FEATURE_PREFER_APPLETS
Make SH_STANDALONE depend on PREFER_APPLETS.
getopt.c: more randomconfig-induced fixes
2007-04-10 23:03:30 +00:00
Denis Vlasenko
c6758a07c6 make compressed help code NOMMU- and NOFORK-friendly -
no forking anymore, bunzip2 unpack routine now does all it in memory.
2007-04-10 21:40:19 +00:00
Denis Vlasenko
335b63d8d1 make a few struct bb_applet members conditional
rename sllep_and_die -> xfunc_die
make fflush_stdout_and_exit NOFORK-safe
fix some buglets found by randomconfig
2007-04-10 21:38:30 +00:00
Bernhard Reutner-Fischer
163516da3a - very minor shrinkage (-3b) 2007-04-10 14:16:19 +00:00
Bernhard Reutner-Fischer
8b1fab2879 - add prototype for str_tolower() 2007-04-10 09:38:07 +00:00
Denis Vlasenko
3f3aa2a57d make xfunctions optionally longjump instead of exit.
use it for making NOFORK more practical.
touch: make it a NOFORK applet
2007-04-09 21:35:07 +00:00
Denis Vlasenko
cd7001f705 factor out NOFORK/NOEXEC code from find. Use it for xargs too. 2007-04-09 21:32:30 +00:00
Denis Vlasenko
c44ab01b75 Improve STANDALONE_SHELL. "safe" applets are renamed NOEXEC applets
and now this fact is recorded in applets.h, not ash.c.

Several fixes to "--help + STANDALONE_SHELL" scenarios.

function                                             old     new   delta
run_current_applet_and_exit                            -     355    +355
arith                                               2064    2073      +9
refresh                                             1148    1156      +8
getopt32                                            1068    1073      +5
telnet_main                                         1510    1514      +4
md5_sha1_sum_main                                    565     566      +1
xstrtoul_range_sfx                                   255     251      -4
packed_usage                                       22523   22514      -9
tryexec                                              255     203     -52
static.safe_applets                                  152       -    -152
.rodata                                           131320  131128    -192
run_applet_by_name                                   869     506    -363
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 5/5 up/down: 382/-772)         Total: -390 bytes

./busybox ash -c 'i=20000; while test $i != 0; do touch z; i=$((i-1)); done'
runs more than twice as fast with STANDALONE_SHELL versus without.
2007-04-09 03:11:58 +00:00
Denis Vlasenko
32b633aa3f merge busybox.c into applets.c 2007-04-09 03:05:48 +00:00
Denis Vlasenko
8d9f495d68 getopt32: fix llist_t options ordering. llist_rev is not unused.
function                                             old     new   delta
tar_main                                             705     695     -10
sort_main                                            928     918     -10
decode_format_string                                 886     876     -10
run_parts_main                                       197     185     -12
ps_main                                              513     500     -13
wget_main                                           2764    2750     -14
awk_main                                            1014    1000     -14
od_main                                             2886    2866     -20
llist_rev                                             25       -     -25
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/8 up/down: 0/-128)           Total: -128 bytes
2007-04-08 15:08:42 +00:00
Denis Vlasenko
bbd695d801 find: fix handling of -prune
recursive_actions: uppercase flag constants
2007-04-08 10:52:28 +00:00
Denis Vlasenko
04c99ebb4f random small shrinkage and elimination of statics 2007-04-07 00:44:31 +00:00
Denis Vlasenko
bf295dd5b6 [u]mount: extend -t option (Roy Marples <uberlord@gentoo.org>) 2007-04-05 21:57:47 +00:00
Denis Vlasenko
1bb552b1d9 libbb: add xunlink()
patch: do not try to delete same file twice
2007-04-05 21:25:15 +00:00
Denis Vlasenko
29fe7265b8 nc: port nc 1.10 to busybox 2007-04-05 20:26:28 +00:00
Denis Vlasenko
992e05b6f0 udpsvd: more work on it. works in limited testing. 2007-04-03 01:13:04 +00:00
Denis Vlasenko
729bd9e0b0 test: comment out unused code
udpsvd: fake it compile
tcpsvd: more optimal memorizing of IP's for -C
2007-04-02 12:37:28 +00:00
Denis Vlasenko
2856dab477 tcpsvd: new applet
It's a GPL-ed 'clone' of Dan Bernstein's tcpserver.
Author: Gerrit Pape <pape@smarden.org>
http://smarden.sunsite.dk/ipsvd/
size tcpsvd.o
   text    data     bss     dec     hex filename
   2571       4      16    2591     a1f tcpsvd.o
2007-04-01 01:18:20 +00:00
Bernhard Reutner-Fischer
3e816c1252 - fold recurse, depthFirst and dereference params into one param flags.
Minor size improvement (-16b for size, -24b according to bloat-o-meter).
2007-03-29 10:30:50 +00:00
Denis Vlasenko
10457b90db make pidfile writing configurable.
[ui]toa_to_buf: change API. No users yet.
2007-03-27 22:01:31 +00:00
Denis Vlasenko
afa7023b46 zcip: make it work on NOMMU (+ improve NOMMU support machinery)
fsck: fix bad English in a comment
2007-03-26 17:25:33 +00:00
Denis Vlasenko
53091ecd20 Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far
(yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO
Also make fork(), daemon() produce warnings on compile stage
(in addition to erros on link stage).
2007-03-26 13:35:09 +00:00
Denis Vlasenko
bb7fcb4229 libbb: rework NOMMU helper API so that it makes more sense
and easier to use. Doesn't compile - need two more commits.
2007-03-26 13:20:04 +00:00
Denis Vlasenko
cad04ef4f3 add NOMMU fixme's; move move_fd from runit_lib to libbb; nuke fd_copy 2007-03-25 23:21:05 +00:00
Denis Vlasenko
8a503be840 #ifdef out re_execed on MMU machines 2007-03-24 16:13:33 +00:00
Denis Vlasenko
9067f13be0 NOMMU re-exec trick shuld not depend on existence of "don't daemonize"
option for every affected applet (and dnsd, for example, don't have one).
Thus rework re-exec support to not require it. Code got smaller too.
2007-03-24 12:11:17 +00:00
Denis Vlasenko
c86e052b81 fix accumulated whitespace and indentation damage 2007-03-20 11:30:28 +00:00
Denis Vlasenko
4b4b619c9c include <stddef.h> so that ptrdiff_t is again available 2007-03-18 20:33:26 +00:00
Mike Frysinger
75acbe322c punt useless header as pointed out by src.obsolete.headers 2007-03-17 06:27:38 +00:00
Denis Vlasenko
bff32ce4d5 gzip: Improve ptr_to_globals trick, allowing gcc
to optimize better. -480 bytes.
2007-03-15 19:48:35 +00:00
Denis Vlasenko
1cc70225e7 networking/interface.c: was doing really strange caching of fd's
open for getting ifconfig data - ??! Simplified all that. -200 bytes.
2007-03-15 19:46:43 +00:00
Denis Vlasenko
972288e62f modify ptr_to_globals trick so that we do not violate
type safety (well, sort of ;))
2007-03-15 00:57:01 +00:00
Denis Vlasenko
7f2527e5a7 arp, networking/interface.c: eliminate statics
and unneeded on-stack buffers, disable (comment out)
some apparently unused (and buggy) code paths. -700 bytes.
2007-03-14 22:11:20 +00:00
Denis Vlasenko
6ef06eeed4 stop using big static buffer for inode hash 2007-03-14 22:06:01 +00:00
Denis Vlasenko
fe42d17318 gzip: bbunzip integration fixes 2007-03-14 00:08:28 +00:00
Denis Vlasenko
39c651e909 introduce and use setfscreatecon_or_die
(patch by Yuichi Nakamura <ynakam@hitachisoft.jp>)
runcon: *yet another* fix for vda's brainfart :(
2007-03-12 18:22:55 +00:00
Denis Vlasenko
1203c9bf2f next portion of selinux updates: chcon, runcon. From
Yuichi Nakamura <himainu-ynakam@miomio.jp>  
KaiGai Kohei <busybox@kaigai.gr.jp>
2007-03-11 22:16:02 +00:00
Denis Vlasenko
49622d7846 selinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> (HitachiSoft) 2007-03-10 16:58:49 +00:00
Denis Vlasenko
02f0c4c2bf diff: failed to confirm "static bug" in gcc - reinstating statics.
microscopic code improvements.
2007-03-09 10:08:53 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00