Commit Graph

1440 Commits

Author SHA1 Message Date
Denis Vlasenko
76c476f817 smart_ulltoa5: emit small letters k,m,g... - makes top
more readable
2007-08-28 20:04:15 +00:00
Denis Vlasenko
b308d81e92 top: use poll instead of select for waiting on one descriptor
smart_ulltoa5: make it more cryptic. -50 bytes.

function                                             old     new   delta
passwd_main                                         1095    1103      +8
getNum                                               557     565      +8
buffer_fill_and_print                                 73      76      +3
udhcpc_main                                         2393    2395      +2
mkfs_minix_main                                     3071    3070      -1
dname_enc                                            377     373      -4
expmeta                                              480     472      -8
smart_ulltoa5                                        334     283     -51
top_main                                             911     815     -96
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/5 up/down: 21/-160)          Total: -139 bytes
   text    data     bss     dec     hex filename
 770872    1063   10788  782723   bf183 busybox_old
 770732    1063   10788  782583   bf0f7 busybox_unstripped
2007-08-28 19:35:34 +00:00
Denis Vlasenko
0f214ecef0 cp: fix recursion check to not waste bytes remembering names of dirs 2007-08-27 17:02:19 +00:00
Denis Vlasenko
8a5fab6333 cp: detect and prevent infinite recursion 2007-08-27 16:51:30 +00:00
Denis Vlasenko
512499c8ca ps: fix RSS parsing (rss field in /proc/PID/stat is in pages, not bytes) 2007-08-26 18:23:13 +00:00
Denis Vlasenko
30bab71f7b make copy_file() a bit easier to understand, and smaller
function                                             old     new   delta
copy_file                                           1565    1447    -118
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-118)           Total: -118 bytes
   text    data     bss     dec     hex filename
 770938    1063   10788  782789   bf1c5 busybox_old
 770814    1063   10788  782665   bf149 busybox_unstripped
2007-08-25 21:14:55 +00:00
Denis Vlasenko
737d131e5e support "#!/bin/busybox"-style wrappers. Needed for SELinux.
Patch by Yuichi Nakamura <ynakam@hitachisoft.jp>
2007-08-25 18:25:24 +00:00
Denis Vlasenko
6666ac42a5 cp,mv: simpler arg[cv] handling -> smallish code savings 2007-08-24 21:46:24 +00:00
Denis Vlasenko
3d829627fb cp: make POSIX-me-harder mode complain with a bit less insane message 2007-08-24 14:23:57 +00:00
Denis Vlasenko
d37f22225b libbb,crond,lash: fix getopt32 (don't know how it managed to slip through)
*: fcntl(fd, F_GETFL) doesn't require third parameter at all.
2007-08-19 13:42:08 +00:00
Denis Vlasenko
fe7cd642b0 don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes
   text    data     bss     dec     hex filename
 773469    1058   11092  785619   bfcd3 busybox_old
 772644    1058   11092  784794   bf99a busybox_unstripped
2007-08-18 15:32:12 +00:00
Denis Vlasenko
367960ba9a make standalone httpd work on NOMMU machines 2007-08-18 14:20:21 +00:00
Denis Vlasenko
a27a11bb2c introduce and use xdup2(int, int)
stop checking whether setsockopt_reuseaddr(int fd) was successful (it always is)
remove second parameter (sockllen) from xmalloc_sockaddr2xxxxx functions

sockaddr2str                                         142     156     +14
collect_blk                                          467     474      +7
xdup2                                                 28      33      +5
singlemount                                         4456    4454      -2
print_host                                           214     212      -2
nslookup_main                                        139     137      -2
ftpgetput_main                                       414     412      -2
udhcpd_main                                         1258    1255      -3
udhcpc_main                                         2405    2402      -3
traceroute_main                                     4125    4122      -3
nc_main                                             1072    1069      -3
buffer_fill_and_print                                 76      73      -3
xmalloc_sockaddr2hostonly_noport                      18      14      -4
xmalloc_sockaddr2host_noport                          18      14      -4
xmalloc_sockaddr2host                                 15      11      -4
xmalloc_sockaddr2dotted_noport                        18      14      -4
xmalloc_sockaddr2dotted                               18      14      -4
wget_main                                           2618    2614      -4
ping_main                                            393     389      -4
ip_port_str                                          120     115      -5
dhcprelay_main                                      1146    1141      -5
dnsd_main                                           1531    1525      -6
passwd_main                                         1110    1102      -8
udhcp_kernel_packet                                  206     197      -9
udhcp_listen_socket                                  154     144     -10
getty_main                                          2576    2566     -10
setup                                                655     640     -15
xmove_fd                                              51      34     -17
dolisten                                             759     742     -17
tcpudpsvd_main                                      1866    1836     -30
startservice                                         339     299     -40
2007-08-18 14:16:39 +00:00
Denis Vlasenko
1b97efd66a httpd shring and logging update, part 1 or 7
text    data     bss     dec     hex filename
   9836       0       0    9836    266c busybox.t1/networking/httpd.o.orig
   9724       0       0    9724    25fc busybox.t2/networking/httpd.o
   9657       0       0    9657    25b9 busybox.t3/networking/httpd.o
   9342       0       0    9342    247e busybox.t4/networking/httpd.o
   9342       0       0    9342    247e busybox.t5/networking/httpd.o
   9262       0       0    9262    242e busybox.t6/networking/httpd.o
   9283       0       0    9283    2443 busybox.t7/networking/httpd.o
   9334       0       0    9334    2476 busybox.t8/networking/httpd.o
2007-08-17 19:18:06 +00:00
Denis Vlasenko
a0319ba936 hdparm: shrink rodata by ~250 bytes 2007-08-16 10:37:49 +00:00
Denis Vlasenko
6a2f7f41cf whitespace fixes, no code changes 2007-08-16 10:35:17 +00:00
Denis Vlasenko
ab9c44b1a4 v[hp]error_msg have 2-3 callsites only -> incorporate there. 2007-08-15 20:07:53 +00:00
Denis Vlasenko
bb23c06919 if pidfile turned out to be !regular file, do not unlink it.
It's most probably the /dev/null.
2007-08-15 20:05:37 +00:00
Denis Vlasenko
384b1d12f9 httpd: add -v[v]: prints client addresses, HTTP codes returned [and URLs]
get_line                                               -      70     +70
packed_usage                                       22811   22863     +52
handle_incoming_and_exit                            2246    2277     +31
httpd_main                                          1141    1155     +14
sendHeaders                                          489     482      -7
getLine                                               77       -     -77
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 3/1 up/down: 167/-84)            Total: 83 bytes
   text    data     bss     dec     hex filename
 774335    1058   11092  786485   c0035 busybox_old
 774447    1058   11092  786597   c00a5 busybox_unstripped
2007-08-14 16:55:01 +00:00
Denis Vlasenko
dbe6e66d6a trylink: automatically use custom link script if user provides one
vinfo_msg: one user (info_msg), incorporate in it
*: style fixes
2007-08-14 16:43:01 +00:00
Denis Vlasenko
3952f20c24 expand, unexpand: new applets from Tito <farmatito@tiscali.it> 2007-08-13 14:10:24 +00:00
Denis Vlasenko
e324184c05 s/#ifdef CONFIG_/#if ENABLE_/g 2007-08-13 10:36:25 +00:00
Denis Vlasenko
6ca409e0e4 trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
  of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts

size saving: 0.5k
2007-08-12 20:58:27 +00:00
Denis Vlasenko
e5d37ccb6e httpd: fix CGI handling bug (we were closing wrong fd). 2007-08-11 20:20:02 +00:00
Denis Vlasenko
f893da875a ls,ps,watch: measure terminal width on fd 0, not 1 2007-08-09 08:27:24 +00:00
Denis Vlasenko
501bfe2630 stat: fix option -Z segv (bug 1454) 2007-08-09 08:10:13 +00:00
Denis Vlasenko
e5dbba22af bb_uudecode: now this is the more thorough fix... I hope... 2007-08-06 15:49:12 +00:00
Denis Vlasenko
4661117911 bb_uuencode: fix obscure case where we were using data past last byte of source
(fixes testsuite failure)

bb_uuencode                                          154     160      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 6/0)                 Total: 6 bytes
   text    data     bss     dec     hex filename
 770284    1096   11228  782608   bf110 busybox_old
 770288    1096   11228  782612   bf114 busybox_unstripped
2007-08-06 15:43:17 +00:00
Denis Vlasenko
0e2c9fb4e0 mount: print errno on NFS error (again) 2007-08-03 14:16:24 +00:00
Denis Vlasenko
80edead5ea udhcp: slight shrink
udhcpd_main                                         1171    1208     +37
udhcpc_main                                         2363    2387     +24
dhcprelay_main                                      1145    1146      +1
dhcprelay_stopflag                                     4       1      -3
dhcprelay_signal_handler                              11       8      -3
client_background                                     46      42      -4
udhcp_read_interface                                 230     211     -19
udhcp_make_pidfile                                    76       -     -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 3/4 up/down: 62/-105)           Total: -43 bytes
   text    data     bss     dec     hex filename
 770052    1096   11228  782376   bf028 busybox_old
 769980    1096   11228  782304   befe0 busybox_unstripped
2007-08-02 22:31:05 +00:00
Denis Vlasenko
1caca34aa6 start_stop_daemon: NOMMU fixes, round 2 by Alex Landau <landau_alex@yahoo.com>
dhcpc: fixed "ifupdown + udhcpc_without_pidpile_creation" bug
2007-08-02 10:14:29 +00:00
Denis Vlasenko
a1b16f4d5c start_stop_daemon: NOMMU fix; smaller fixes 2007-07-31 17:09:44 +00:00
Denis Vlasenko
1bab1de698 fix for suffix optimization (which was in previous commit) 2007-07-27 15:30:39 +00:00
Denis Vlasenko
3734b946bf bb_getpwuid, bb_getgrgid: change order of arguments to more intuitive one;
comment thoroughly when they die and when they dont.
2007-07-27 11:20:10 +00:00
Denis Vlasenko
f4cee7a174 getopt32: fix getopt32 breakage (forgot to memset(0) it) -- thanks rockeychu 2007-07-25 17:18:06 +00:00
Denis Vlasenko
990d0f63ee Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.

   text    data     bss     dec     hex filename
 781266    1328   11844  794438   c1f46 busybox_old
 781010    1328   11844  794182   c1e46 busybox_unstripped
2007-07-24 15:54:42 +00:00
Denis Vlasenko
5bfcb4d5ae getopt32 must remain NOFORK-safe (no mallocs!). Using alloca and pretending
stack is infinite. Unfortunately, +79 bytes.
2007-07-23 17:40:35 +00:00
Denis Vlasenko
bdc88fdc68 rework long option handling. saves ~1.2k
function                                             old     new   delta
tar_longopts                                           -     222    +222
static.udhcpc_longopts                                 -     192    +192
start_stop_daemon_longopts                             -     150    +150
getopt32                                            1045    1185    +140
static.wget_longopts                                   -     111    +111
static.od_longopts                                     -     105    +105
getopt_longopts                                        -      96     +96
install_longopts                                       -      67     +67
ipcalc_longopts                                        -      63     +63
static.hwclock_longopts                                -      54     +54
ftpgetput_longopts                                     -      52     +52
static.dumpleases_longopts                             -      32     +32
env_longopts                                           -      31     +31
runparts_longopts                                      -      30     +30
mv_longopts                                            -      24     +24
mkdir_longopts                                         -      19     +19
find_pair                                            164     180     +16
bb_null_long_options                                   -      16     +16
setconsole_longopts                                    -      10     +10
display_speed                                         91      98      +7
collect_blk                                          467     474      +7
show_color                                             4       1      -3
ls_main                                              913     904      -9
bb_default_long_options                               16       -     -16
ls_color_opt                                          32      10     -22
setconsole_long_options                               32       -     -32
arith                                               2077    2030     -47
mv_long_options                                       48       -     -48
mkdir_long_options                                    48       -     -48
env_long_options                                      48       -     -48
static.options                                       248     184     -64
runparts_long_options                                 80       -     -80
ftpgetput_long_options                                96       -     -96
static.hwclock_long_options                          112       -    -112
install_long_options                                 112       -    -112
static.long_options                                  144       -    -144
static.wget_long_options                             160       -    -160
longopts                                             160       -    -160
static.arg_options                                   304       -    -304
tar_long_options                                     320       -    -320
long_options                                         384       -    -384
------------------------------------------------------------------------------
(add/remove: 17/15 grow/shrink: 4/5 up/down: 1444/-2209)     Total: -765 bytes
   text    data     bss     dec     hex filename
 782618    1328   11900  795846   c24c6 busybox_old
 781354    1328   11900  794582   c1fd6 busybox_unstripped
2007-07-23 17:14:14 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
091965768d libbb: nuke BB_GETOPT_ERROR, always die if there are mutually exclusive options
find_pair                                            164     180     +16
passwd_main                                         1222    1230      +8
display_speed                                         91      96      +5
msh_main                                            1335    1339      +4
qrealloc                                              38      36      -2
refresh                                             1190    1182      -8
cut_main                                             543     532     -11
sendCgi                                             1807    1794     -13
getopt32                                            1063    1045     -18
arith                                               2077    2030     -47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/6 up/down: 33/-99)            Total: -66 bytes
   text    data     bss     dec     hex filename
 781548    1168   11900  794616   c1ff8 busybox_old
 781452    1168   11900  794520   c1f98 busybox_unstripped
2007-07-21 13:27:44 +00:00
Denis Vlasenko
557fb713e0 chpasswd: fixes and code shrink
update_passwd                                        732     734      +2
chpasswd_main                                        318     292     -26
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-26)             Total: -24 bytes
   text    data     bss     dec     hex filename
 781564    1168   11900  794632   c2008 busybox_old
 781548    1168   11900  794616   c1ff8 busybox_unstripped
2007-07-21 13:25:28 +00:00
Denis Vlasenko
1ec5eaecba chpasswd: now with svn add 2007-07-20 21:29:49 +00:00
Denis Vlasenko
21d1014b5b chpasswd: new applet by Alexander Shishkin <virtuoso@slind.org> 2007-07-20 21:28:41 +00:00
Denis Vlasenko
2f6ae43b9c stray trailing tabs removed 2007-07-19 22:50:47 +00:00
Denis Vlasenko
49a128a156 remove accumulated stray trailing whitespace 2007-07-17 21:42:59 +00:00
Denis Vlasenko
fb79a2e2cf xioctl and friends by Tito <farmatito@tiscali.it>
function                                             old     new   delta
do_iptunnel                                          203     977    +774
process_dev                                         5328    5494    +166
ioctl_or_perror                                        -      54     +54
ioctl_or_perror_and_die                                -      51     +51
ioctl_alt_func                                         -      49     +49
bb_ioctl_or_warn                                       -      47     +47
do_add_ioctl                                         102     145     +43
bb_xioctl                                              -      39     +39
print_value_on_off                                     -      31     +31
get_lcm                                              105     123     +18
arp_main                                            2155    2167     +12
..................
zcip_main                                           1576    1566     -10
setlogcons_main                                       92      82     -10
dumpkmap_main                                        263     253     -10
do_get_ioctl                                          85      75     -10
setkeycodes_main                                     165     154     -11
write_table                                          244     232     -12
vconfig_main                                         318     306     -12
do_del_ioctl                                          93      81     -12
set_address                                           75      62     -13
maybe_set_utc                                         30      16     -14
loadfont_main                                        495     479     -16
slattach_main                                        712     695     -17
do_loadfont                                          191     174     -17
do_iplink                                           1155    1136     -19
getty_main                                          2583    2562     -21
fbset_main                                          2058    2035     -23
do_time                                              588     565     -23
xioctl                                                25       -     -25
read_rtc                                             186     160     -26
parse_conf                                          1299    1270     -29
udhcp_read_interface                                 269     239     -30
bb_ioctl                                              45       -     -45
bb_ioctl_alt                                          70       -     -70
bb_ioctl_on_off                                       78       -     -78
.rodata                                           129370  129018    -352
do_show                                              799       -    -799
------------------------------------------------------------------------------
(add/remove: 6/5 grow/shrink: 13/49 up/down: 1316/-1864)     Total: -548 bytes
   text	   data	    bss	    dec	    hex	filename
 675352	   2740	  13968	 692060	  a8f5c	busybox_old
 674804	   2740	  13968	 691512	  a8d38	busybox_unstripped
2007-07-14 22:07:14 +00:00
Denis Vlasenko
d166f83d74 md5_sha1_sum: fix mishandling when run as /bin/md5sum (with path)
chown/chgrp: completely match coreutils 6.8 wrt symlink handling

function                                             old     new   delta
recursive_action                                     411     422     +11
arith                                               2033    2042      +9
collect_blk                                          467     474      +7
dhcprelay_main                                      1122    1125      +3
fsck_main                                           1909    1911      +2
singlemount                                         4555    4547      -8
xmalloc_realpath                                      14       -     -14
get_lcm                                              123     105     -18
ed_main                                             3111    3084     -27
chown_main                                           217     183     -34
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 5/4 up/down: 32/-101)           Total: -69 bytes
   text    data     bss     dec     hex filename
 684132    2744   14000  700876   ab1cc busybox_old
 684060    2744   14000  700804   ab184 busybox_unstripped
2007-07-05 00:12:55 +00:00
Denis Vlasenko
54e19da86d correct_password: if password is 'x' or '*' and there is no shadow, use
fake encrypted password 'aa' (which is guaranteed to fail password check).
2007-07-03 10:28:46 +00:00
Denis Vlasenko
e190c16636 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
2007-07-03 06:15:42 +00:00
Denis Vlasenko
4b9b0ced30 find: fix build failure on certain configs
(found by Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>)
2007-07-01 17:35:17 +00:00
Denis Vlasenko
98ebab8b76 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
2007-06-30 14:47:41 +00:00
Denis Vlasenko
8b1409896d add bb_basename.c 2007-06-30 10:58:08 +00:00
Denis Vlasenko
dc757aa16c 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
2007-06-30 08:04:05 +00:00
Denis Vlasenko
f7d07b1723 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
2007-06-30 08:03:26 +00:00
Denis Vlasenko
42ee26d00c 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
2007-06-30 08:01:04 +00:00
Denis Vlasenko
e8240f19bd 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
2007-06-26 15:59:37 +00:00
Denis Vlasenko
80b8b39899 Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>) 2007-06-25 10:55:35 +00:00
Denis Vlasenko
198badafd8 pidof: size optimizations (-50 bytes) 2007-06-23 14:56:43 +00:00
Denis Vlasenko
931de892cc random shrinkage of statics, -60 bytes saved 2007-06-21 12:43:45 +00:00
Denis Vlasenko
88976d00d8 remove extra ')' 2007-06-21 07:09:18 +00:00
Denis Vlasenko
7510384107 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.
2007-06-20 14:49:47 +00:00
Denis Vlasenko
31789a81d5 top,ps: 'stringify' tty only when needed. -60 bytes. 2007-06-19 14:43:17 +00:00
Denis Vlasenko
362c6ec694 top: speedup if tty info is not requested 2007-06-19 13:53:12 +00:00
Denis Vlasenko
3afac4ce06 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
2007-06-19 13:46:24 +00:00
Denis Vlasenko
a61cb92f2d make /etc/network parsing configurable. -200 bytes when off. 2007-06-19 11:24:47 +00:00
Denis Vlasenko
6d9ea24611 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
2007-06-19 11:12:46 +00:00
Denis Vlasenko
1b16bdaebf 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
2007-06-19 11:10:02 +00:00
Denis Vlasenko
91e149a373 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
2007-06-18 10:35:06 +00:00
Mike Frysinger
ebd27aabaa fix an obvious typo while trying to access the tv_usec member 2007-06-18 07:12:31 +00:00
Denis Vlasenko
bd7bb299c0 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
2007-06-17 23:40:26 +00:00
Denis Vlasenko
459be35234 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
2007-06-17 19:09:05 +00:00
Denis Vlasenko
85532fc4d4 remove obsolete comment 2007-06-16 14:16:30 +00:00
Denis Vlasenko
53a0e97196 find: make -size match GNU find 2007-06-16 00:30:52 +00:00
Bernhard Reutner-Fischer
867266059b - vda perfers not to use the banner 2007-06-15 08:30:33 +00:00
Denis Vlasenko
d8540f71ac init: make sure fd 0,1,2 are not closed, + related optimizations.
init_main                                            929     920      -9
bb_daemonize_or_rexec                                145     127     -18
2007-06-14 07:53:06 +00:00
Denis Vlasenko
ca525b4f24 *: 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
2007-06-13 12:27:17 +00:00
Denis Vlasenko
d67cef2425 hush: fix read builtin to not read ahead past eol and to not use
insane amounts of stack. Testsuite updated.
2007-06-13 06:47:47 +00:00
Denis Vlasenko
f5f75c5e82 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
2007-06-12 22:35:19 +00:00
Denis Vlasenko
f312e32662 login: make /etc/nologin support configurable. -240 bytes if not selected. 2007-06-12 22:04:57 +00:00
Denis Vlasenko
3ad5d0cbbe 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
2007-06-12 20:54:54 +00:00
Denis Vlasenko
15611bb958 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
2007-06-12 08:52:02 +00:00
Denis Vlasenko
aa198dd39c uudecode: nuke duplicate base64_table[]. saves 65 bytes 2007-06-12 07:24:11 +00:00
Bernhard Reutner-Fischer
d71e45856e - use bb_msg_full_version instead of a separate string. Saves a minor 3 bytes. 2007-06-11 15:09:21 +00:00
Denis Vlasenko
5a65447e30 top: add config option and code for global CPU % display 2007-06-10 17:11:59 +00:00
Denis Vlasenko
e8a0788b24 moved biggest stack buffers to malloc space, or made their size configurable
(8k of shell line edit buffer is an overkill)

# make ARCH=i386 bloatcheck
function                                             old     new   delta
read_line_input                                     3933    3967     +34
ifaddrlist                                           348     345      -3
do_loadfont                                          208     191     -17
edit_file                                            840     819     -21
.rodata                                           129112  129080     -32
uncompress                                          1305    1268     -37
loadfont_main                                        566     495     -71
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 34/-181)          Total: -147 bytes
2007-06-10 15:08:44 +00:00
Denis Vlasenko
65e14b4588 login: ask passwords even for wrong usernames.
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 680099    2704   15648  698451   aa853 busybox_old
 680110    2704   15648  698462   aa85e busybox_unstripped
2007-06-08 15:27:06 +00:00
Denis Vlasenko
bdbbb7ec49 make busybox --install work even if /proc/self/exe doesn't exist
# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 680095    2704   15648  698447   aa84f busybox_old
 680099    2704   15648  698451   aa853 busybox_unstripped
2007-06-08 15:02:55 +00:00
Denis Vlasenko
0696b8aae8 ps: fix -Z (by Yuichi Nakamura <ynakam@hitachisoft.jp>) 2007-06-06 07:40:16 +00:00
Denis Vlasenko
5c51a7ca52 nc: make connecting to IPv4 from IPv6-enabled hosts easier
(was requiring -s <local addr>)
2007-06-05 20:08:11 +00:00
Denis Vlasenko
74324c8666 Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
2007-06-04 10:16:52 +00:00
Denis Vlasenko
9a7d38fe24 delete tons of extra #includes 2007-05-31 22:42:12 +00:00
Denis Vlasenko
fad2b86c9e use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228)        Total: -89 bytes
2007-05-31 22:16:38 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
4ef7d3a2de verror_msg: don't printf(NULL) 2007-05-29 21:41:28 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
5a6aeddfa7 xpipe: introduce (saves ~170 bytes)
udhcp/signalpipe.c: use pipe instead of socketpair.
2007-05-26 16:44:20 +00:00
Denis Vlasenko
b055001b6a hush: fix handling of unmatched ${name (without closing '}') -
was eating all remaining input, potentially megabytes.
nofork: save/restore die_jmp too
nofork: use -2222 instead of -111 as "special" return valur for zero
(-111 is used by some applets. -2222 won't fit in exitcode and thus safer)
2007-05-24 12:18:16 +00:00
Denis Vlasenko
96f67dc69d more compile fixes from randomconfig run 2007-05-17 13:02:41 +00:00
Denis Vlasenko
d46e6d1a55 fix trivial compile errors found by randomconfig run 2007-05-17 12:58:30 +00:00
Denis Vlasenko
a035e9f1a9 cryptpw: forgot svn add... how typical of me :( 2007-05-08 23:23:35 +00:00
Denis Vlasenko
7e84e539de cryptpw: new applet (a bit less than 3k added)
(by Thomas Lundquist <lists@zelow.no>)
2007-05-08 17:52:17 +00:00
Denis Vlasenko
3bc18253b0 fix suid config handling 2007-05-02 23:01:32 +00:00
Denis Vlasenko
dcf4de20a1 test: code size saving, no logic changes
ps: fix warning, make a bit smaller
kill -l: make smaller & know much more signals

function                                             old     new   delta
get_signum                                           121     153     +32
kill_main                                            826     843     +17
get_signame                                           44      36      -8
signals                                              252     224     -28
.rodata                                           131955  131923     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 49/-68)            Total: -19 bytes
2007-05-01 20:07:29 +00:00
Denis Vlasenko
18e19f2b0d hush: fix nofork + ctrl-Z clobbering of globals 2007-04-28 16:43:18 +00:00
Denis Vlasenko
706fdc98c3 find_root_device: use lstat - don't follow links 2007-04-21 23:28:03 +00:00
Denis Vlasenko
54e7ffb3a4 hush: begin fixing non-functional job control 2007-04-21 00:03:36 +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
c34d35557b loop device code: readability improvement 2007-04-19 00:09:34 +00:00
Denis Vlasenko
0922192740 lineedit: state->hist_file doesn't exist if !FEATURE_EDITING_SAVEHISTORY,
#ifdef it out
2007-04-15 13:21:01 +00:00
Denis Vlasenko
5f9468e996 lineedit: nuke two unused variables and code which sets them
applets: do not even try to read config if run by real root
msh: use named constants (O_RDONLY etc) in open() instead of magic numbers,
     other minor code size reduction.
2007-04-14 13:22:09 +00:00
Denis Vlasenko
bf3561fd15 lineedit: do not try to open NULL history file 2007-04-14 10:10:40 +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
Denis Vlasenko
1d6a4aec2c make xsocket die with address family printed (if VERBOSE_RESOLUTION_ERRORS=y) 2007-04-13 21:26:20 +00:00
Denis Vlasenko
0de3c55b42 login: remove setpgrp call (makes it work from shell prompt again).
login: sanitize stdio descriptors (we are suid, need to be careful!)
shrink login and set_environment by ~100 bytes.
2007-04-12 12:31:02 +00:00
Denis Vlasenko
831a20f512 pass a copy of argv[i] to NOFORK applets (they may permute it etc).
set/save/restore more shared global variables whan call one applet from another
2007-04-12 12:27:32 +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
51742f4bb0 style fixes. No code changes 2007-04-12 00:32:05 +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
d571c08c25 fix misplaced #if 2007-04-11 07:26:56 +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
f1a7141cfc random NOMMU fixes. compressed --help really does work for NOMMU! /me happy 2007-04-10 23:32:37 +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
Denis Vlasenko
99912ca733 audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
2007-04-10 15:43:37 +00:00
Denis Vlasenko
ff131b980d style fixes. No code changes. 2007-04-10 15:42:06 +00:00
Bernhard Reutner-Fischer
7e8a53a335 - add libbb function str_tolower to convert a string to lowercase.
- shrink wget a bit
2007-04-10 09:37:29 +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
53d445aa75 wait4pid: if passed with pid < 0, do not set errno - it is already set by exec! 2007-04-09 13:21:33 +00:00
Denis Vlasenko
7e754f12d3 Implement first instance of NOFORK applet - echo
find: use NOFORK/NOEXEC; small -exec buglet also eliminated
vfork_daemon_rexec: honor PREFER_APPLETS
echo: small size improvements

find -exec echo {} \; with PREFER_APPLETS=y runs 4 times faster
2007-04-09 13:04:50 +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
5a30d59c3d svn add match_fstype.c :( 2007-04-05 22:19:43 +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
Bernhard Reutner-Fischer
bdd253e450 - fix segfault in reset_ino_dev_hashtable() when *hashtable was null.
Seen in the testsuite for du -l .../testsuite on exit with CLEAN_UP enabled.
2007-04-05 09:21:24 +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
eceecea568 - fix bug where we did not reject invalid classes like '[[:alpha'
- debloat while at it:
   text    data     bss     dec     hex filename
   1554       0      19    1573     625 tr.o.oorig
   1357       0      16    1373     55d tr.o
2007-03-30 14:43:27 +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
450196c119 ps: work around libc bug: printf("%.*s\n", MAX_INT, buffer) 2007-03-28 21:57:12 +00:00
Denis Vlasenko
6a5598c2bc pidfile creation mode set to 0666 (umask affects it as usual) 2007-03-27 22:05:34 +00:00
Denis Vlasenko
ebf48bb80c forgotten svn add... 2007-03-27 22:02:06 +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
f4d40c87d3 remove_file: cosmetic code improvement, a few bytes saved 2007-03-26 23:14:38 +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
219d14d514 random style fixes (extra spaces deleted) 2007-03-24 15:40:16 +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
1b6fa4c57c applets.c, xfunc.c: style cleanup 2007-03-24 12:08:36 +00:00
Denis Vlasenko
c86e052b81 fix accumulated whitespace and indentation damage 2007-03-20 11:30:28 +00:00
Denis Vlasenko
6b343ddbc8 fix inadvertently leaked PWD_BUFFER_SIZE 2007-03-18 00:57:15 +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
54d14ca1a2 copy_file: comment out one condition which is always false.
Add comment explaining POSIX rules for cp - and why
these rules are dangerous. Provide conditionally compiled code
for both POSIX and safe behaviors, select safe for now.
Code shrunk by ~80 bytes.
2007-03-15 13:33:37 +00:00
Denis Vlasenko
24af7201e9 fix TODO: getopt32 should reset optind to 1 itself 2007-03-15 13:28:46 +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
5659407595 swapon: reinstate hole check but reduce it to warning
inode_hash: remove unused variable
2007-03-14 22:55:39 +00:00
Denis Vlasenko
6ef06eeed4 stop using big static buffer for inode hash 2007-03-14 22:06:01 +00:00
Denis Vlasenko
75ab6af71e stop using (yet another) static buffer 2007-03-14 21:56:51 +00:00
Denis Vlasenko
07766bb0e7 gzip: reduce global data footprint, part 3 2007-03-14 00:06:51 +00:00
Denis Vlasenko
da799e8227 gzip: reduce global data footprint, part 2 2007-03-14 00:06:29 +00:00
Denis Vlasenko
5df955fce2 Do not fail password check if shadow password does not exist -
fall back to ordinary one

Reduced usage of functions returning datain static buffers.
(mostly passwd/group/shadow related):

function                                             old     new   delta
correct_password                                     143     193     +50
sulogin_main                                         490     533     +43
adduser_main                                         732     774     +42
passwd_main                                         1875    1915     +40
addgroup_main                                        330     365     +35
bb_internal_getspnam                                  38       -     -38
bb_internal_fgetpwent                                 38       -     -38
bb_internal_fgetgrent                                 38       -     -38
static.resultbuf                                     168      88     -80
static.buffer                                       1872    1104    -768
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 5/2 up/down: 210/-962)         Total: -752 bytes
2007-03-13 13:01:14 +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
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
c115fdbc80 ifupdown: code to deconstruct the state_list gracefully
(patch by Gabriel L. Somlo <somlo@cmu.edu>)
2007-03-06 22:53:10 +00:00
Denis Vlasenko
19c238bc90 ping: don't measure times if ping payload is less than 8 bytes;
commonalize some ping code.
2007-03-03 00:36:35 +00:00
Denis Vlasenko
54cf511ce1 sort: fix multiple -k (was ignoring all except last) 2007-02-17 18:11:45 +00:00
Denis Vlasenko
ec27feb045 init: code readability enhancements; very small code changes 2007-02-17 15:52:02 +00:00
Denis Vlasenko
b5368bf437 httpd: a little bit more correct handling of CGI "HTTP/xxx" output 2007-02-13 23:42:54 +00:00
Denis Vlasenko
6ca0444420 syslogd: fix "readpath bug" by using readlink instead
libbb: rename xgetcwd and xreadlink
2007-02-11 16:19:28 +00:00
Denis Vlasenko
9ca26d38c5 ping: support -I addr in family neutral manner; reuse a bit of common code 2007-02-09 17:32:16 +00:00
Mike Frysinger
0aa6ba5d44 make sure ps/top output what they claim: vsz, not rss ... down the line we should make the output controllable either at runtime or buildtime as both statistics are quite useful 2007-02-08 08:21:58 +00:00
Denis Vlasenko
0850cdabde tftp: fix IPv6 fallout 2007-02-07 23:20:32 +00:00
Denis Vlasenko
710694f0e5 fix #ifdef ENABLE_xxx -> #if 2007-02-07 20:27:03 +00:00
Denis Vlasenko
d46d3c292e new applets: selinux utils by KaiGai Kohei <kaigai@kaigai.gr.jp> 2007-02-06 19:28:50 +00:00
Denis Vlasenko
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Bernhard Reutner-Fischer
d909d23451 - indent 2007-02-04 20:32:38 +00:00
Denis Vlasenko
e991303406 udhcp: use improved gethostbyname replacement from IPv6 code 2007-02-04 02:41:57 +00:00
Denis Vlasenko
5870ad9672 mount: (try to) support cifs with IPv6 2007-02-04 02:39:55 +00:00
Denis Vlasenko
42823d597a add x to IPv6 functions which can die 2007-02-04 02:39:08 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
e968fcd562 lineedit: add missing #if/#endif
init: fix warnings
2007-02-03 02:42:47 +00:00
Denis Vlasenko
4921b54f37 Add BB_EXEC[LV]P() which encapsulate FEATURE_EXEC_PREFER_APPLETS
(patch from Gabriel L. Somlo <somlo@cmu.edu>)
2007-02-03 02:17:41 +00:00
Denis Vlasenko
ab2aea4447 preparatory patch for -Wwrite-strings #4 2007-01-29 22:51:58 +00:00
Denis Vlasenko
b6aae0f381 preparatory patch for -Wwrite-strings #2 2007-01-29 22:51:25 +00:00
Denis Vlasenko
a41fdf331a preparatory patch for -Wwrite-strings #1 2007-01-29 22:51:00 +00:00
Denis Vlasenko
e06bed30cf use bb_sanitize_stdio() where appropriate 2007-01-27 22:21:12 +00:00
Denis Vlasenko
434ad5456b fix warning in find.c 2007-01-27 13:45:17 +00:00
Denis Vlasenko
98c0bba09d fix bin2hex bug. lowercase = uppercase | 0x20, not | 0x10! 2007-01-26 23:31:05 +00:00
Denis Vlasenko
86724af484 bb_parse_mode: do not do umask() needlessly. 2007-01-26 22:54:01 +00:00
Denis Vlasenko
b9a279ba94 Unify ping and ping6. ping has -4 and -6 which force
name resolution into IP or IPv6 only, otherwise
we take address family returned by host2sockaddr()
in lsa->sa.sa_family. IOW: "ping ::1" with do IPv6 ping,
"ping 127.0.0.1" will do IPv4 ping.
ping6 is aliased to "ping -6".
2007-01-24 23:53:22 +00:00
Denis Vlasenko
218f2f4882 accumulated post-1.4.0 fixes 2007-01-24 22:02:01 +00:00
Denis Vlasenko
769d1e05e6 fix warning from needlessly-global functions 2007-01-22 23:04:27 +00:00
Denis Vlasenko
d77f7c3136 remove empty source files 2007-01-22 22:47:07 +00:00
Denis Vlasenko
9adc6ced4f ping6: stop using xgethostbyname2, remove it from libbb. 2007-01-22 22:45:27 +00:00
Denis Vlasenko
448f0241e0 nslookup: full circle. Here we started IPv6 work. Use "new API"
and thus save a few bytes.
2007-01-22 22:43:05 +00:00
Bernhard Reutner-Fischer
835f575b61 - the archivers expect mode to be a mode_t, so do not trip signed/unsigned conversion purposefully 2007-01-22 17:48:08 +00:00
Bernhard Reutner-Fischer
bb8c7c041c - sed -i -e "/\$Id:/d;" 2007-01-22 17:04:53 +00:00
Denis Vlasenko
703e20235a cleanups: unnecessary casts, unified const_1, eliminate cross-.c file
prototypes (heresy!), add spaces in places like "flags&NETSTAT_CONNECTED",
removed unused #defines, #ifdef -> #if, use uint32_t for ipv4 addrs.
2007-01-22 14:12:08 +00:00
Denis Vlasenko
35d4da0fb5 exterminate u_intXXX.
fix ping6 buglet (memset is too short), minor sync between ping and ping6
2007-01-22 14:04:27 +00:00
Denis Vlasenko
85629f08bc comment out unused old networking API parts
sockaddr2dotted: return IPV6 addrs in [addr]:port form (was addr:port)
2007-01-22 09:36:41 +00:00
Denis Vlasenko
95fef7071e move shell/cmdedit.c -> libbb/lineedit.c 2007-01-22 09:03:42 +00:00
Denis Vlasenko
38f6319421 cmdedit is not a 'command' editing anymore, it's just editing (generic),
so rename stuff accordingly.
2007-01-22 09:03:07 +00:00
Denis Vlasenko
2f0c0d0b88 Introduce FEATURE_EXEC_PREFER_APPLETS = "re-execute our own
executable if we asked to exec someting with argv[0] == known_applet"
Use it in init. Also respect PATH in init, remove explicit "/sbin" etc
from exec. Patch by Gabriel L. Somlo <somlo@cmu.edu>
2007-01-21 00:41:04 +00:00
Bernhard Reutner-Fischer
af45760cca - get_terminal_width_height does not and should never write to fd. Cosmetic Precaution 2007-01-20 21:33:50 +00:00
Denis Vlasenko
4ebaf10742 strdup -> xstrdup
sed: de-obfuscate piece of code
2007-01-19 21:33:19 +00:00
Denis Vlasenko
2405ad659e ls: use get_cached_username/groupname 2007-01-19 21:24:17 +00:00
Denis Vlasenko
9af7c9d6b6 openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup code
(will close all fd's > 2 on daemonization now)
getty: fix "getty -" support, and also do not try to chown/chmod "-"
telnetd: fix "lost ctty" bug
Yet another attempt on saner function names:
bb_sanitize_server_stdio(0/1) -> bb_sanitize_stdio() + bb_daemonize();
2007-01-19 21:19:35 +00:00
Denis Vlasenko
ef44d9d9f2 sed,get_line_from_file: improve comments 2007-01-17 23:16:16 +00:00
Denis Vlasenko
d97c9244b1 Rename bb_sanitize_stdio -> bb_sanitize_server_stdio
(name is still bad - it doesn't hint that function
may do daemonization trick for you if asked to).
Small fixes to fakeidentd.
2007-01-14 13:12:06 +00:00
Denis Vlasenko
7a431b3715 By popular request reinstate fakeidentd's standalone mode.
Since this is also needed for other applets like telnetd,
introduce generic driver for such things.
It even supports inetd-wait ('linger') mode, when inetd
hands out listen socket to child and waits to it to die,
instead of handing out accepted socket and continuing
listening itself (nowait mode).
Code growth ~200 bytes.
NB: our inetd doesn't support wait mode yet (or mabe it is buggy).
2007-01-14 01:29:06 +00:00
Denis Vlasenko
2418288cac small fixes to ipv6 infrastructure 2007-01-13 21:05:38 +00:00
Denis Vlasenko
3a34d0c08a random small size optimizations 2007-01-12 22:10:34 +00:00
Denis Vlasenko
5d68724d5b next part of ipv6-ization. mostly netcat. 2007-01-12 20:59:31 +00:00
Denis Vlasenko
6536a9b583 next part of ipv6-ization is here: wget & httpd 2007-01-12 10:35:23 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko
8e9ccba371 ipv6-ization efforts continue. Few bugs are found,
unknown number likely introduced...
2007-01-11 16:50:23 +00:00
Denis Vlasenko
bbe514683a a bit more IPv6-ization work
syslogd: converted to use it (in -R host:port)
2007-01-10 20:19:56 +00:00
Denis Vlasenko
9de420c27c Improve generic ipv4+ipv6 support in libbb.
Convert telnet to it. Now this works:
telnetd -b [::1]:1234 - bind to IPv6 non-standard port
telnet [::1]:1234 - connect to IPv6 non-standard port
telnet ::1 1234 - same
This does not require ANY ipv6-specific code in applets
(no struct sockaddr_in6. In fact, no sockaddr_in, too).
2007-01-10 09:28:01 +00:00
Denis Vlasenko
a9b60e93ee new libbb func: xmalloc_realpath (+ use it where makes sense)
syslogd, logread: add debugging code (disabled)
syslogs: drastically smaller bss; fix "-C n" behaviour
2007-01-04 17:59:59 +00:00
Denis Vlasenko
9b1381fd2f convert calloc to xzalloc
fix sleep-on-die option
2007-01-03 02:56:00 +00:00
Denis Vlasenko
4a64c33443 about.html: update maintainer name
libbb/Kbuild: less needs xregcomp.o
2006-12-30 22:03:02 +00:00
Denis Vlasenko
6a5dc5d75a next bunch of fixes for bugs found by randconfig 2006-12-30 18:42:29 +00:00
Denis Vlasenko
9a44c4f91c bb_xget[pw/gr]nam were horribly misnamed - fixed.
uidgid_get -> get_uidgid, add additional param
(numeric_ok). Make chown use it.
chown: fix "chown user: ...."
install: fix incorrect use of bb_xget[pw/gr]nam
2006-12-28 05:44:47 +00:00
Denis Vlasenko
666da5e2c6 merge post-1.3.0 fixes 2006-12-26 18:17:42 +00:00
Denis Vlasenko
bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko
5dd7ef0f37 chattr: bugfixes and size reduction 2006-12-26 03:36:28 +00:00
Denis Vlasenko
0de9375ee6 leftover of e2fsck surgery 2006-12-26 02:51:29 +00:00
Denis Vlasenko
7cea262273 small stupid changes. no code changes 2006-12-24 07:30:09 +00:00
Denis Vlasenko
a5b3e76c38 missing piece of prev commit: ndelay_off 2006-12-24 07:15:50 +00:00
Denis Vlasenko
1dc1b37b33 use xbind, xconnect where appropriate.
small edits to arping
2006-12-23 02:48:44 +00:00
Denis Vlasenko
2a813e20e2 fix recognitions of -SIGname signals
(fix by Jacques LUDER <jacques.luder@thalesgroup.com>)
2006-12-23 01:06:21 +00:00
Denis Vlasenko
8f6c79240d find: fix spurious -exec error messages
(bug reported by Bernhard Fischer <rep.nop@aon.at>)
2006-12-23 00:49:10 +00:00
Denis Vlasenko
714701c890 tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
2006-12-22 00:21:07 +00:00
Denis Vlasenko
e865e81d34 less: stop dying on bad regexps, quietly pipe data w/o
user interaction if stdout is not a tty.
size optimizations
2006-12-21 13:24:58 +00:00
Denis Vlasenko
bf66fbc8e2 introduce LONE_CHAR (optimized strcmp with one-char string) 2006-12-21 13:23:14 +00:00
Denis Vlasenko
3f3190e34c less: total cleanup and bugfix.
Doesn't die horribly on binary files anymore.
In fact, they _100%_ work now. Control chars
are in reverse video, including DEL and that idiocy of VT-10x,
Meta-ESC [inventor of which should be prohibited from reproducing].
Regex search is fixed also. When you specify search ('/' key),
control chars turn into dots (unhighlighted),
and found occurrences highlighted instead. This is reversible.
Memory management fixed (was leaky as hell) and optimized.
Linewrapping fixed and thoroughly tested.
Max buffer size made configurable.
~ 600 bytes saved.
2006-12-21 00:22:03 +00:00
Denis Vlasenko
9a7cef930f less: somewhat buggy applet, but nice. Muchly reduced
xstrdup'ing and memory consumption. Made linewrap saner.
regex matching code was awful - still buggy, but not as
leaky as before. Made buffer size configurable. Killed
several static and on-stack buffers. Hopefully eliminated
staircase effect on Ctrl-C (unable to reproduce).
2006-12-20 02:46:48 +00:00
Denis Vlasenko
b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +00:00
Denis Vlasenko
15b213ef5a su: make /etc/shells check configurable
ash: missing ';'
2006-12-19 00:20:20 +00:00
Denis Vlasenko
7cfecc4b36 xfuncs.c: dietlibc actually HAS fdprintf!
platform.h: define strchrnul for dietlibc
ash: stop using few non-standard functions
2006-12-18 22:32:45 +00:00
Denis Vlasenko
c8e6e35ba4 nc: add missing cast
xfuncs: add dprintf for dietlibc
2006-12-18 22:10:24 +00:00
Denis Vlasenko
83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +00:00
Denis Vlasenko
b131b271a0 start_stop_daemon: fix bug where any program name was "matching"
processes for which readlink(/proc/N/exe) fails
2006-12-17 17:30:01 +00:00
Denis Vlasenko
9f739445cd inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid] 2006-12-16 23:49:13 +00:00
Denis Vlasenko
a597aaddfa s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
2006-12-16 23:48:13 +00:00
Denis Vlasenko
6a1d661036 diff: fix -q exit code
last_char_is: sacrifice 9 bytes but avoid double-scan
2006-12-16 22:18:44 +00:00
Denis Vlasenko
5e2db5e8ee build system: small fix for "release" target to work 2006-12-12 23:46:31 +00:00
Denis Vlasenko
2ea630f9a5 bb_makedev: fix for glibc 2.3.2
sed: fix C++ style declaration
2006-12-10 02:52:19 +00:00
Bernhard Reutner-Fischer
bbda98f14c - cosmetic change to avoid warnings about eventual padding/packing. 2006-12-04 15:58:27 +00:00
Denis Vlasenko
8b22b07bc5 sed: improve handling of NULs 2006-12-02 17:58:10 +00:00
Denis Vlasenko
becd8c538c passwd: made smaller by ~130 bytes. size can go negative
if current trend will continue ;)
2006-12-01 21:34:20 +00:00
Denis Vlasenko
002526481e passwd: small size optimization. salt generation improved
(really generated different salts even if called back-to-back).
2006-11-30 20:41:28 +00:00
Denis Vlasenko
ab24e18c7a passwd: rework:
* do not make backup copy by copying (just retain old file)
* correctly fall back to /etc/passwd if user is not in shadow
* fix bug with overlong passwd entries
* be permissive on some kinds of failures
* reduce stack usage
* code size: -500 bytes
2006-11-30 16:41:15 +00:00
Denis Vlasenko
c6ce8733dd cut 0.5k off mkfs.minix
assorted strtoul fixes (that's what brought me into minix)...
2006-11-29 18:15:52 +00:00
Denis Vlasenko
df38188367 fix bug in new str -> num convertors 2006-11-28 10:54:16 +00:00
Denis Vlasenko
f1a6c6b362 erase_mtab: do not limit ourself to 40 mtab entries 2006-11-27 17:29:09 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
079f8afa0a style cleanup: return(a) -> return a, part 1 2006-11-27 16:49:31 +00:00
Denis Vlasenko
3ece72dc3f svn add bb_strtonum.c :( 2006-11-27 15:12:16 +00:00
Denis Vlasenko
d686a045c8 safe_strtoXX interface proved to be a bit unconvenient.
Remove it, introduce saner bb_strtoXX.
Saved ~350 bytes.
2006-11-27 14:43:21 +00:00
Denis Vlasenko
e5667c1cfe Closing bug 730. libbb run_parts is using scandir (a GNUism),
and it is used only by run_parts applet, so move it there.
Also saved ~30 bytes (prolly gcc autoinlining...).
2006-11-26 20:13:39 +00:00
Denis Vlasenko
cf749bc10c small fixes:
fix xstrdup to not grossly overallocate memory
use xopen instean of xopen3 in several places
etc.
2006-11-26 15:45:17 +00:00
Denis Vlasenko
2d27e4ccbb tee: fix bug: argv[-1] is a no-no!
bb_full_fd_action: optimize
die_if_ferror: "<applet>: filename" isn't a good err msg, add "..I/O error"
2006-11-25 23:50:28 +00:00
Denis Vlasenko
43bddf31e9 small improvements in str -> num convertors 2006-11-25 14:49:04 +00:00
Denis Vlasenko
ed836cdc30 regularize str -> num convertors 2006-11-25 14:44:13 +00:00
Denis Vlasenko
809a6e3104 small optimization 2006-11-24 22:42:44 +00:00
Denis Vlasenko
3feb2fc535 tar: fix multiple -t and/or -v options handling.
do not process list of files to tar up in reverse order.
2006-11-24 21:55:55 +00:00
Denis Vlasenko
d031ffa623 tar: sanitize option handling 2006-11-24 21:54:44 +00:00
Denis Vlasenko
d6772501db tar: fix and sanitize handling of long filenames/linknames
(GNU extensions 'K' and 'L').
We correctly handle them when untarring now, but unfortunately
we still don't use them when tarring! That stupid 100 char limit
is still there!
The biggest problem is that we don't support 'pax' tar format.
Linux kernel tarballs are in this format... shame
2006-11-24 17:21:44 +00:00
Denis Vlasenko
d398ecab9d hunt down improper include <>, make mkswap output 4Gb+ friendly 2006-11-24 15:38:03 +00:00
Denis Vlasenko
8023d7df78 svn add makedev.c. Forgot as usual... :( 2006-11-24 15:06:28 +00:00
Denis Vlasenko
b8a8e601df tar: small fixes:
* size-optimize mapping code
* kill double close
2006-11-24 14:59:45 +00:00
Denis Vlasenko
c50f370f98 tar: cache [ug]id->username/groupname mappings. Cuts down amount
of open/read/close of /etc/passwd and /etc/group
dramatically (we were rereading those for each untarred file!!!)
2006-11-24 14:57:31 +00:00
Denis Vlasenko
4fbb584a0e tar: cry murder and bail out if file shrinks under us while we tar it up 2006-11-24 14:55:23 +00:00
Denis Vlasenko
0b35470d9b glibc makedev() is a large inline. Save 700+ bytes by wrapping it
into a function.
2006-11-24 14:54:27 +00:00
Denis Vlasenko
376ce1e775 tar:
* unpack: handle tar header fields which are not NUL terminated
* pack: handle 4+GB files correctly
* pack: refuse to store 101+ softlinks (was truncating link
  target name)
* pack: mask mode with 07777
2006-11-24 14:51:01 +00:00
Denis Vlasenko
48237b0c88 introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
2006-11-22 23:22:06 +00:00
Denis Vlasenko
81e264d4af fix double merge 2006-11-22 17:42:06 +00:00
Denis Vlasenko
c8717cd857 telnetd: move generic stuff into libbb. It will make it easy
to make other server applets IPv6-aware too.
2006-11-22 16:10:39 +00:00
Denis Vlasenko
75f8d080a2 telnetd: we were having telnetd with is ONLY inetd or ONLY standalone.
What if I need to have both?? This patch introduces
CONFIG_FEATURE_TELNETD_STANDALONE: y - both, n - only inetd.
2006-11-22 15:54:52 +00:00
Denis Vlasenko
5e618ff439 xgethostbyname: more readable 2006-11-21 20:35:22 +00:00
Denis Vlasenko
7ca3921e5e bb_INET_default[] is really just a const "default",
nothing INET-specific
2006-11-21 20:34:21 +00:00
Denis Vlasenko
89f0b3486d rodata cleanup. "unable to" == "cannot". -300 bytes 2006-11-18 22:04:09 +00:00
Denis Vlasenko
83ea643d8d svlogd: new applet. +9k. Still too big, but it was 12k yesterday. 2006-11-16 02:27:24 +00:00
Denis Vlasenko
067e3f031a wget: fix error message.
Bad:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
: HTTP/1.0 404 Not Foundror 404 Not Found
Good:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
get: server returned error: HTTP/1.0 404 Not Found

nslookup: fix my mistake
applets: make Bernhard Fischer <rep.nop@aon.at> happy :)
2006-11-10 23:25:53 +00:00
Denis Vlasenko
5af906e7c8 rename: compare_string_array -> index_in_str_array
introduce index_in_substr_array and use it in
iproute2
2006-11-05 18:05:09 +00:00
Denis Vlasenko
aae0311356 smart_ulltoa5: make available in libbb 2006-11-05 00:44:39 +00:00
Denis Vlasenko
459e4d6cf7 replace /proc scanning code by more versatile one.
Use it where appropriate.
Stop scanning /etc/passwd *for every process*!!! (uid->username)
top: reduce memory usage - we won't save unneeded fields
from /proc info anymore. Downside: ~+250 bytes of code
2006-11-05 00:43:51 +00:00
Denis Vlasenko
fa07680091 top: improve CPU% calculation
style fixes
2006-11-05 00:38:51 +00:00
Denis Vlasenko
dd539f7687 Unneeded code removed, usused field "unsigned pscpu" removed 2006-11-01 20:20:37 +00:00
Denis Vlasenko
35fb512728 PID should be stored in pid_t, not int or long.
find_pid_by_name() was returning 0 or -1 in last array element,
but -1 was never checked. We can use just 0 intead.
2006-11-01 09:16:49 +00:00
Denis Vlasenko
966ec7c067 #if CONFIG_xxx -> #if ENABLE_xxx 2006-11-01 09:13:26 +00:00
Denis Vlasenko
b141b9b512 reads: fix bug 1078 2006-10-31 22:46:08 +00:00
Denis Vlasenko
6ae8079e2d login: re-enable Ctrl-^C before execing shell. 2006-10-31 17:34:44 +00:00
Denis Vlasenko
3b8ff68ec8 dd: fix bugs: always assumed conv=sync, died on write errors
w/o perror and statictics. Several small improvements
2006-10-31 15:55:56 +00:00
Denis Vlasenko
5d499e1600 find: a lot more compliant to 'standard' find
(we were not respecting order of actions!).
Add -o and -a handling.
2006-10-29 19:07:01 +00:00
Denis Vlasenko
5c7596058d ls: cleanup part 1 2006-10-28 12:37:16 +00:00
Denis Vlasenko
8c35d65c43 recursive_action: add depth param
chmod: match coreutils versus following links
2006-10-27 23:42:25 +00:00
Denis Vlasenko
3b8fc1c582 recursive_action: preparatory changes. will introduce "int level". 2006-10-27 17:59:14 +00:00
Denis Vlasenko
cf70433173 modprobe: reformat to match bbox style 2006-10-27 15:12:50 +00:00
Denis Vlasenko
dca0b707c0 reshuffle libbb.h contents so that order of decls makes sense
Found bad typo in largefile support :)
2006-10-27 09:05:02 +00:00
Denis Vlasenko
621204bbf6 get_terminal_width_height: do not pass insanely large values 2006-10-27 09:03:24 +00:00
Denis Vlasenko
d3d004dd35 last nail into error_msg() (de)capitalization 2006-10-27 09:02:31 +00:00
Denis Vlasenko
1340ca8c87 As usual, I forgot "svn del"... 2006-10-27 07:17:36 +00:00
Denis Vlasenko
2fe7b73d99 ...and yet another small fix. Ouch... 2006-10-26 23:39:04 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko
f0ed376eda remove bb_printf and the like 2006-10-26 23:21:47 +00:00
Denis Vlasenko
1457915afc xconnect is non-conforming to "xfunc like libc" rule. Fixing 2006-10-26 01:09:46 +00:00
Denis Vlasenko
c8400a2162 wget: wget $'-\207' ... should not be allowed to work. ever. :)
So fix wget & getopt32. Also fix multiple --header options
order: add and use rev_llist.
2006-10-25 00:33:44 +00:00
Denis Vlasenko
f24e1f40e0 cp: add support for -s, -l. Fix free(nonmalloc) bug.
Add doc on POSIX's rules on -i and -f (insane!).
ln: make "ln dangling_symlink new_link" work.
2006-10-21 23:40:20 +00:00
Denis Vlasenko
456fa6c0b1 readlink: do not emit errors if file doesnt not exist / not a link
getopt32: add =N support
2006-10-20 18:36:55 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
d0e70af9d1 nc: fix 2 my own buglets, and few someone else's too. 2006-10-16 01:10:28 +00:00
Denis Vlasenko
3a6755f56f grep: add support for -r 2006-10-14 14:24:30 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
88ca067690 xread/write can use full_read/write (smaller code) 2006-10-12 22:44:13 +00:00
Denis Vlasenko
2d5ca60bfb bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
2006-10-12 22:43:20 +00:00
Denis Vlasenko
372686bde7 cut, mount: small improvements 2006-10-12 22:42:33 +00:00
Denis Vlasenko
a6dbb08a48 small style fixes 2006-10-12 19:29:44 +00:00
Denis Vlasenko
12f5676cce execable: no need to check getenv for NULL, it works anyway. 2006-10-12 06:15:13 +00:00
Denis Vlasenko
5cb46485dd execable.c: forgot to do "svn add" again... 2006-10-12 06:12:11 +00:00
Denis Vlasenko
f6f43df60b ifupdown: stop emitting annoying/misleading error messages.
Patch by Gabriel Somlo <somlo at cmu.edu>
2006-10-11 22:16:56 +00:00
Denis Vlasenko
1db39b2f51 nmeter: new applet. ~4k
Fix build proble on x86_64
2006-10-11 20:59:02 +00:00
Denis Vlasenko
1114de7219 od: provide full-blown od from coreutils if CONFIG_DESKTOP 2006-10-10 23:26:05 +00:00
Denis Vlasenko
cba9ef5523 fixes from Vladimir Dronnikov <dronnikov@gmail.ru> 2006-10-10 21:00:47 +00:00
Denis Vlasenko
ca3c981c07 start_stop_daemon: add -N <nice> compat
[re]nice: add support for -nNNN w/o spaces, -NNN (nice only),
          simplified code
2006-10-08 23:36:17 +00:00
Denis Vlasenko
7039a66b58 correct largefile support, add comments about it. 2006-10-08 17:54:47 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko
c12f53090b dnsd fix; option_mask32 added. dnsd needs more love. 2006-10-06 09:49:47 +00:00
Denis Vlasenko
de59c0f58f httpd: add -u user[:grp] support 2006-10-05 22:50:22 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Denis Vlasenko
8f8f268cfd bb_applet_name -> applet_name 2006-10-03 21:00:43 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Denis Vlasenko
40920825d5 rename bb_default_error_retval -> xfunc_error_retval 2006-10-03 20:28:06 +00:00
Denis Vlasenko
b6332248ca fdformat: remove redundant check 2006-10-03 19:57:50 +00:00
Denis Vlasenko
cf94446af7 random style fixes 2006-10-03 19:02:20 +00:00
Denis Vlasenko
fe54458e46 runit/chpst: "change process state" utility
It's "nice" on steroids - can set uid/gid, mem/cpu limits etc. +3.5k
2006-10-03 15:57:40 +00:00
Denis Vlasenko
b97c9842a5 sed: unbreak multiple -e, -f option handling (my fault) 2006-10-01 21:05:12 +00:00
Denis Vlasenko
55a994055f lsmod: repair indentation
httpd: ifdef CONFIG -> if ENABLE (shorted, catched typos)
2006-09-30 20:41:44 +00:00
Denis Vlasenko
a959588b80 Yet another silly little byte saving. couldn't -> cannot 2006-09-29 21:30:43 +00:00
Denis Vlasenko
266bc17690 top: add support for -b, -n <iterations> 2006-09-29 17:16:39 +00:00
Denis Vlasenko
f0d6cc8ca9 getopt_ulflags: fix indentation in comment (needs to be 8 _spaces_
in order to look correct to both 4 tab and 8 tab population).
Add comment about :: (which indicates optional argument).
2006-09-29 13:56:58 +00:00
Denis Vlasenko
b02ef82c99 getopt_ulflags: formatting fixes 2006-09-29 08:23:42 +00:00
Denis Vlasenko
6248a734e2 xargs: simplify option parsing 2006-09-29 08:20:30 +00:00
Denis Vlasenko
524176680d Tried to find sha1_crypt - nope... ok, save few bytes in md5_sha1_sum.c
(time to sleep, 02:28 in the morning)...
2006-09-28 00:29:00 +00:00
Denis Vlasenko
de9ec92958 usage.h: fix compile-time bugs exposed by previous change 2006-09-27 23:31:59 +00:00
Denis Vlasenko
a77947f5bb kill: fix bugs (kill -l output was horrible), fix style, constify data 2006-09-27 14:19:16 +00:00
Denis Vlasenko
be905d550c process utilities related style cleanup 2006-09-27 14:17:31 +00:00
Denis Vlasenko
a552eeb498 wget: add (configurable) large file support. Run tested. 2006-09-26 09:22:12 +00:00
Denis Vlasenko
a94554d010 wget: fix bug where wget creates null file if there is no remote one.
add O_LARGEFILE support (not run tested :).
2006-09-23 17:49:09 +00:00
Denis Vlasenko
c290563319 remove unneeded #includes, fix indentation 2006-09-23 16:01:09 +00:00
Denis Vlasenko
a36a676923 correct_password: undo whitespace damage.
vlock + correct_password: fix incorrect line breaks in messages.
2006-09-23 13:11:49 +00:00
Denis Vlasenko
6429aabbf1 bb_askpass: shorten static password buffer. 256 is way too large.
simplify code a bit.
2006-09-23 12:22:11 +00:00
Denis Vlasenko
27ee7ba95e losetup: getopt_ulflags'ification + small fix for perror_nomsg 2006-09-22 14:53:41 +00:00
Rob Landley
fbdf121b7d Teach get_terminal_width_height to fall back to $LINES and $COLUMNS when
used via things like a serial console.
2006-09-20 22:06:01 +00:00
Denis Vlasenko
0b5fd45ef7 change char *string = "foo" -> char string[] = "foo"
function                                             old     new   delta
xsetenv                                               45      44      -1
iproute_list_or_flush                               1834    1833      -1
ipaddr_modify                                       1915    1914      -1
ipaddr_list_or_flush                                1861    1860      -1
invarg                                                39      38      -1
do_set                                              1259    1258      -1
bb_verror_msg                                        268     267      -1
create_icmp_socket                                   142     140      -2
create_icmp6_socket                                  142     140      -2
bb_full_fd_action                                    324     322      -2
bb_path_mtab_file                                     10       -     -10
.rodata                                           214796  214720     -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/11 up/down: 0/-99)            Total: -99 bytes
2006-09-19 09:55:09 +00:00
Denis Vlasenko
9213a9e0f2 whitespace cleanup 2006-09-17 16:28:10 +00:00
Denis Vlasenko
6231e870ec style fixes 2006-09-17 15:45:48 +00:00
Rob Landley
da9d1d079e Strangely, using // in the comments I added was not a persistent accident. 2006-09-14 19:52:07 +00:00
Bernhard Reutner-Fischer
7fee0c4357 - fix copy'n paste errors that got introduced when switching to the shorter boilerplate.
No object code changes.
2006-09-13 16:39:19 +00:00
Rob Landley
20cc6d567f Remove pointless "const". Bloatcheck says 0 bytes difference. 2006-09-12 21:42:17 +00:00
Bernhard Reutner-Fischer
b5f50ea344 - small trivia to be gentle to gcc-2.95.x which had no va_copy but only __va_copy. 2006-09-12 13:27:55 +00:00
Bernhard Reutner-Fischer
428a5cd0d3 - fix warning about discarding qualifiers in initialization 2006-09-12 13:25:16 +00:00
Bernhard Reutner-Fischer
57b56674a3 - merge xstat.c into xfuncs.c 2006-09-11 09:18:09 +00:00
Denis Vlasenko
0c45bb23d2 tar: fix "xopen with O_CREAT" warning, improve zero padding write
(was doing zillions of 1-byte write syscalls)
2006-09-09 12:49:03 +00:00
Denis Vlasenko
bd8f43dbab few random readability enhansements. No code changes 2006-09-08 17:31:55 +00:00
Denis Vlasenko
2e502914b0 login: style fixes 2006-09-08 17:22:45 +00:00
Denis Vlasenko
a9801658ee getty, sulogin: convert to using bb_msg for syslog output 2006-09-07 16:20:03 +00:00
Denis Vlasenko
b750dec40a fix if (ENABLE_FEATURE_SYSLOG & (...)) - should be && 2006-09-07 16:03:45 +00:00
Denis Vlasenko
049d6b8c08 Add CONFIG_FEATURE_SYSLOG which controls whether
bb_xx_msg will ever try to send output to syslog.
Add "select CONFIG_FEATURE_SYSLOG" to relevant applets.
This allows to omit syslog code if we do not have
any syslog-capable applets in the build.
2006-09-07 06:02:39 +00:00
Denis Vlasenko
3da6aa878a adding files missed in prev updates (forgot about svn add) 2006-09-07 05:09:22 +00:00
Denis Vlasenko
6d655be5df removed a lot of trailing \n in bb_msg() calls. It is added
automatically by function itself.
2006-09-06 19:02:46 +00:00
Denis Vlasenko
3538b9a882 Implement optional syslog logging using ordinary
bb_xx_msg calls, and convert networking/* to it.
The rest of bbox will be converted gradually.
2006-09-06 18:36:50 +00:00
Bernhard Reutner-Fischer
e614eaf40d - mdev and grep use xregcomp. Closes bug #1021 2006-09-06 13:24:39 +00:00
Denis Vlasenko
797b4d210d run_shell.c: style fix 2006-09-05 09:45:30 +00:00
Denis Vlasenko
d25a2645f5 xfunc: fix: && -> &. Also nuked two double semicolons... 2006-09-05 09:36:19 +00:00
Denis Vlasenko
21afc7dc29 uuencode: common implementation for wget and uuencode (closing bug 694) 2006-09-03 15:49:40 +00:00
Denis Vlasenko
65dbd8752b zcip: getopt -> bb_getopt_ulflags 2006-09-03 12:27:25 +00:00
Denis Vlasenko
27af5a0dd3 replacing func() with xfunc() where appropriate 2006-09-03 12:21:59 +00:00
Bernhard Reutner-Fischer
73561cc75a - pull from busybox_scratch: r15829:15850
Various fixes, cleanups and shrinkage:
saves 952 Bytes:
   text    data     bss     dec     hex filename
1087742   15853  790632 1894227  1ce753 ../busybox/busybox.old
1086790   15853  790632 1893275  1ce39b busybox
via:
# scripts/bloat-o-meter ../busybox/busybox_unstripped.old busybox_unstripped 
function                                             old     new   delta
ipcrm_main                                           756     822     +66
getval                                                 -      61     +61
maybe_set_utc                                          -      40     +40
udhcpc_main                                         2896    2912     +16
md5_hash_block                                       428     437      +9
opt                                                    8      16      +8
qgravechar                                           106     110      +4
make_bitmap                                          292     295      +3
inflate_unzip                                       2056    2059      +3
add_partition                                       1412    1414      +2
__parsespent                                         156     158      +2
qrealloc                                              41      42      +1
format                                                 -       1      +1
catv_main                                            313     314      +1
watch_main                                           293     292      -1
varunset                                              81      80      -1
part                                                   1       -      -1
check_if_skip                                        837     836      -1
start_stop_daemon_main                               840     837      -3
create_lost_and_found                                175     172      -3
supress_non_delimited_lines                            4       -      -4
static.l                                               4       -      -4
static.c                                               5       1      -4
bsd_sum_file                                         237     233      -4
eval2                                                338     332      -6
arithmetic_common                                    166     158      -8
cmpfunc                                               22       5     -17
cksum_main                                           294     275     -19
cmp_main                                             465     439     -26
dd_main                                             1535    1508     -27
rmmod_main                                           376     333     -43
cut_file                                             727     644     -83
ipcs_main                                           3809    3721     -88
cut_main                                             722     614    -108
date_main                                           1443    1263    -180
remove_ids                                           222       -    -222
------------------------------------------------------------------------------
(add/remove: 3/4 grow/shrink: 11/18 up/down: 217/-853)       Total: -636 bytes
2006-08-28 23:31:54 +00:00
Rob Landley
b8cea6dcb3 Jordan Crouse submitted a patch to only include xregcomp.c when we actually
use it, thus fixing building against uClibc with regex support disabled.
2006-08-28 20:04:46 +00:00
Rob Landley
abfe107f78 No real need for my_query_module() and this eliminates some type-punned
pointer warning on certain gcc versions (and saves 38 bytes).
2006-08-28 19:40:08 +00:00
Bernhard Reutner-Fischer
d591a360d3 - merge -r15463:15564 from busybox_scratch branch through these changesets:
------------------------------------------------------------------------
r15465 | aldot | 2006-06-21 20:48:06 +0200 (Wed, 21 Jun 2006) | 3 lines

- use CONFIG_BUSYBOX_EXEC_PATH as before it one was broken by a recent revert.
- use xchdir() since all is invain if it fails there anyways, supposedly

------------------------------------------------------------------------
r15466 | aldot | 2006-06-21 20:55:16 +0200 (Wed, 21 Jun 2006) | 2 lines

- adjust docs to take CONFIG_BUSYBOX_EXEC_PATH into account.

------------------------------------------------------------------------
r15467 | aldot | 2006-06-21 21:31:24 +0200 (Wed, 21 Jun 2006) | 18 lines

- partial fallout of my TREE_USED touchup against gcc-4.2: rip unused vars, save
s 144 bytes
   text    data     bss     dec     hex filename
 862434   10156  645924 1518514  172bb2 busybox.old
 862322   10156  645892 1518370  172b22 busybox
function                                             old     new   delta
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
gzip_main                                            898     822     -76
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/3 up/down: 0/-120)           Total: -120 bytes


------------------------------------------------------------------------
r15468 | aldot | 2006-06-21 21:43:05 +0200 (Wed, 21 Jun 2006) | 19 lines

- remove useless global exports
function                                             old     new   delta
rpm_main                                             940    1601    +661
rpm_getstring                                        107     112      +5
rpm_getint                                           148     153      +5
loop_through_files                                   103     106      +3
fileaction_dobackup                                  115     113      -2
fileaction_list                                        5       -      -5
rpm_getcount                                          42       -     -42
extract_cpio_gz                                      161       -    -161
rpm_gettags                                          504       -    -504
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 4/1 up/down: 674/-714)          Total: -40 bytes

   text    data     bss     dec     hex filename
 862322   10156  645892 1518370  172b22 busybox.old
 862290   10156  645892 1518338  172b02 busybox


------------------------------------------------------------------------
r15555 | aldot | 2006-06-30 14:10:11 +0200 (Fri, 30 Jun 2006) | 22 lines

- shrink syslog a little bit, move a big buffer (for 'line') off the bss, fold s
emaphore stuff into single caller manually.
  stats:
function                                             old     new   delta
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
small                                                  1       -      -1
local_logging                                          4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
syslogd_main                                        1299    1285     -14
static.res                                            36      16     -20
.rodata                                           186650  186586     -64
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/5 grow/shrink: 2/3 up/down: 48/-1136)        Total: -1088 bytes
cow@s37:~/src/busybox_scratch$ size sysklogd/syslogd.o{.orig,}
   text    data     bss     dec     hex filename
   3723     348    5242    9313    2461 sysklogd/syslogd.o.orig
   3697     348    4188    8233    2029 sysklogd/syslogd.o

==============================================================================
Overall bloatcheck for the changeset mentioned above:
function                                             old     new   delta
rpm_main                                             953    1608    +655
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
rpm_getstring                                        107     110      +3
rpm_getint                                           148     151      +3
loop_through_files                                   103     104      +1
small                                                  1       -      -1
fileaction_dobackup                                  115     113      -2
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
local_logging                                          4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
fileaction_list                                        5       -      -5
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
clear_bufs                                            31      21     -10
syslogd_main                                        1287    1273     -14
builtin_help                                         190     176     -14
static.res                                            36      16     -20
builtin_source                                       229     199     -30
rpm_getcount                                          42       -     -42
gzip_main                                            842     786     -56
.rodata                                           227176  227112     -64
lash_main                                            609     527     -82
busy_loop                                           3883    3739    -144
extract_cpio_gz                                      155       -    -155
rpm_gettags                                          501       -    -501
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/15 grow/shrink: 6/12 up/down: 710/-2221)     Total: -1511 bytes
2006-08-20 17:35:13 +00:00
Rob Landley
519d7df930 Another whack at scripts/individual. Now builds 212 applets. 2006-08-09 20:56:23 +00:00
Rob Landley
e3781b7312 Add shared subtree support, suggested by Vladimir Dronnikov. Also break out a
few new (unfinished) config options, which I intend to make hidden (but
enabled) when CONFIG_NITPICK is disabled.  Getting the .config infrastructure
to do that is non-obvious, it seems...
2006-08-08 01:39:49 +00:00
Rob Landley
23b61be0df Add comments to all the functions in this file documenting what they're for. 2006-08-04 20:20:03 +00:00
Rob Landley
2c55fcac08 Thinko spotted by Vladimir Dronnikov. 2006-08-04 05:24:58 +00:00
Rob Landley
081e38483e Remove xcalloc() and convert its callers to xzalloc(). About half of them
were using "1" as one of the arguments anyway, and as for the rest a multiply
and a push isn't noticeably bigger than pushing two arguments on the stack.
2006-08-03 20:07:35 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
Rob Landley
534374755d Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
2006-07-16 08:14:35 +00:00
Rob Landley
df822f2606 We need xsetuid() and xsetgid() because per-user process resource limits can
prevent a process from switching to a user that has too many processes, and
when that happens WE'RE STILL ROOT.  See http://lwn.net/Articles/190331/
2006-07-15 23:00:46 +00:00
Mike Frysinger
83169c607b Tito writes: If the gecos field of an user is empty, obscure reports a false "similar to gecos" error. 2006-07-15 03:59:00 +00:00
Rob Landley
1f9145c5c3 More minor tweaks. 2006-07-12 21:31:16 +00:00
Mike Frysinger
58dda84ecc decuddle () from for/if/while 2006-07-12 20:04:00 +00:00
Rob Landley
c9c1a41c58 A couple things that got tangled up in my tree, easier to check in both than
untangle them:

Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the
signal list to that required by posix (they can specify the numbers for
the rest if they really need them).  (This is preparatory cleanup for adding
a timeout applet like Roberto Foglietta wants.)

Export the itoa (added due to Denis Vlasenko, although it's not quite his
preferred implementation) from xfuncs.c so it's actually used, and remove
several other redundant implementations of itoa and utoa() in the tree.
2006-07-12 19:17:55 +00:00
Rob Landley
ab7d9be17c Patch from Tito to remove pwd_to_spwd (which we don't actually need), with
some #ifdef removal from me.
2006-07-11 16:19:17 +00:00
Rob Landley
22d3958d76 Denis Vlasenko spotted the lack of bounds checking in my first attempt at
itoa/utoa.
2006-07-11 00:44:36 +00:00
"Robert P. J. Day"
5d8843e451 Replace current verbose GPL stuff in libbb/*.c with one-line GPL boilerplate. 2006-07-10 11:41:19 +00:00
Rob Landley
5b88a38157 Add itoa and utoa to see what Denis Vlasenko thinks. 2006-07-10 07:41:34 +00:00
Rob Landley
9ebd1bd468 Attempt to address Shaun Jackman's problem adding "busybox: busybox.bflt" to
.config.mak.
2006-07-06 20:02:47 +00:00
"Robert P. J. Day"
c9f423a93d Correct the comment to match the code. 2006-07-02 19:52:52 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
"Robert P. J. Day"
087b9d640e Allow a user-configurable minimum password length. 2006-07-02 18:35:39 +00:00
"Robert P. J. Day"
edd9ca5743 More removal of "#if 0" content. 2006-07-01 14:52:12 +00:00
"Robert P. J. Day"
68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
Rob Landley
8bbdb8732f This kind of paranoia is a debug option at best. 2006-06-30 16:36:56 +00:00
Rob Landley
a6e6037219 Fix bug http://bugs.busybox.net/view.php?id=874 where hexdump -C got its
spacing wrong.
2006-06-28 14:36:50 +00:00
Rob Landley
22f383e695 Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top. 2006-06-27 18:14:12 +00:00
Rob Landley
a892bf8284 Whitespace. (Vim's auto-indent is kind of annoying at times, like "daytime"
and "nighttime"...)
2006-06-25 15:37:28 +00:00
Rob Landley
934da82913 Fix a possible race condition if two processes try to claim the same loop
device at the same time.  We should only CLR_FD if the set status fails,
not if the SET_FD fails.
2006-06-25 15:29:12 +00:00
Rob Landley
c983274565 The logic to make cp -d or -P treat things like regular files should only
trigger for symlinks, not for device nodes.  This should fix "cp -a /dev ."
to work as expected (when run by root, anyway).

While I was there, cleanup headers and make an #ifdef go away...
2006-06-24 21:27:36 +00:00
Rob Landley
8437ede6c2 The type changed too. 2006-06-20 16:43:05 +00:00
Peter Kjellerstedt
5ab8f7de4f Use the new names for tty_baud_to_value() and tty_value_to_baud() again. 2006-06-20 16:35:37 +00:00
Rob Landley
57c1f73dd5 Revert the last two patches to go back to a state before this file was
controversial.
2006-06-20 16:17:24 +00:00
Rob Landley
290fcb4213 Undo all of the ugliness and some of the bloat from 15412. 2006-06-18 23:59:03 +00:00
Rob Landley
ea224be6aa skip_whitespace() shouldn't claim its return value is const, it doesn't know
that and callers wind up typecasting it back.
2006-06-18 20:20:07 +00:00
Mike Frysinger
b000586d02 danf writes: stty doesn't support baud rates > 460800 bps, the attached patch adds support for all baud rates supported by Linux 2.6.16 on x86. 2006-06-17 22:41:28 +00:00
Rob Landley
d9a761d9c3 Revert svn 15333. If you vfork, you must either exec or exit. (The parent is
blocked until you do so.)
2006-06-16 16:35:53 +00:00
Rob Landley
c7ddefc062 Attempt at fixing bug 815 by upgrading bb_spawn() so that builtins are at
the start of the path.  (This should be under the same config option as
the standalone shell, but right now that's buried in the shell menu.)

Also add the ability to specify CONFIG_BUSYBOX_EXEC_PATH with /proc/self/exe
as an overrideable default.
2006-06-14 01:24:33 +00:00
Rob Landley
18958e9309 Random cleanup of platform.h. 2006-06-13 18:28:33 +00:00
Bernhard Reutner-Fischer
2d1a6e7c1f - fix bug #887, in bb_get_chomped_line_from_file(), the last char was removed
unconditionally, even if it was not a newline.
  This was apparently broken by r14254
- whitespace while at it.
2006-06-10 11:04:43 +00:00
Paul Fox
6ab037872f made "test" an ash built-in.
moved the contents of libbb/bb_echo.c back into coreutils/echo.c,
which is a more reasonable place for them than libbb.  this
forces anyone who wants echo and test to be builtin to ash to
also have them available as applets.  their cost is very small,
and the number of people who wouldn't want them as applets is
also very small.

added warning about shell builtins vs. CONFIG_FEATURE_SH_STANDALONE_SHELL,
which conflicts with their use.

thanks to nathanael copa for debugging help.

some string size optimization in test.c may have been lost with
this commit, but this is a good new baseline.
2006-06-08 21:37:26 +00:00
Mike Frysinger
6fb5847faf sometimes daemonizing and vfork()/exit() is ok 2006-06-07 21:48:30 +00:00
Mike Frysinger
ca70774293 bb_xdaemon() isnt available on no-mmu systems 2006-06-07 21:47:34 +00:00
Mike Frysinger
373af43bb0 comment all fields 2006-06-07 21:37:59 +00:00
Mike Frysinger
301ad67912 add reference to proc(5) 2006-06-07 20:24:34 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Mike Frysinger
828d6bb3bc whitespace 2006-06-07 20:04:13 +00:00
Mike Frysinger
62a2c15376 whitespace 2006-06-07 20:03:13 +00:00
Bernhard Reutner-Fischer
f9437aaf5b - make getopt_ulflags aware of CONFIG_GETOPT_LONG 2006-05-31 14:12:51 +00:00
Bernhard Reutner-Fischer
f3ac9ebc8e - convert xcalloc(1,x) to xzalloc 2006-05-31 13:31:16 +00:00
Bernhard Reutner-Fischer
c418d482ba - s/defined(__uClinux__)/BB_NOMMU/
This needs a second pass to:
+ add bb_daemon(unsigned char no_chdir, unsigned char no_close, const char*flag)
+ eventually globally export argc and argv, so we don't need to pass it to
  bb_daemon().
2006-05-31 10:19:51 +00:00
Rob Landley
bba7f08d27 Add SWAP_LE?? and SWAP_BE?? macros, and make things use them. Converts values
to/from little endian or big endian, which is a NOP if that's what the current
platform already is.
2006-05-29 05:51:12 +00:00
Rob Landley
8bb50782a5 Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
2006-05-26 23:44:51 +00:00
Rob Landley
5edc10275e Slight sanity fix: data is void *, not char *. And it's called data
almost everywhere, so be consistent.
2006-05-26 23:00:10 +00:00
Bernhard Reutner-Fischer
781e42d66c - introduce and use bb_path_wtmp_file for portability (saves 11 Bytes).
- fix last.c to also look at the double-underscore UT_ defines.
2006-05-26 14:41:40 +00:00
Bernhard Reutner-Fischer
76b82cfd6f - make find_mount_point conditional on df and eject; Fixes `make hosttools´ on
hosts where mntent.h does not exist.
2006-05-26 13:38:43 +00:00
Mike Frysinger
4f93a63467 errno and h_errno values are not the same #876 by rfelker 2006-05-26 01:56:42 +00:00
Rob Landley
399d2b5c24 Rich Felker suggested removing dprintf() from watch, and one thing led to
another... This adds bb_xspawn() support, which does vfork/exec.  (I don't
know why using a static instead of a local adds ~40 bytes, but using
the local doesn't work...)
2006-05-25 23:02:40 +00:00
Rob Landley
80b8ff07ca A pending item in my tree I might as well check in: I plan to migrate calloc()
and bb_calloc() calls to bb_xzalloc() which allocates prezeroed memory but
only takes one argument (the size).
2006-05-19 20:36:49 +00:00