Commit Graph

388 Commits

Author SHA1 Message Date
Denis Vlasenko
bd1aeeb850 logger: "clean up" a dirty hack a bit 2008-06-11 15:43:19 +00:00
Denis Vlasenko
7bdf0c82da klogd: make help text more understandable
klogd: by using a register instead of global variable, shrink code a bit

function                                             old     new   delta
klogd_main                                           372     362     -10
packed_usage                                       24504   24486     -18
   text    data     bss     dec     hex filename
 808464     642    7180  816286   c749e busybox_old
 808422     642    7180  816244   c7474 busybox_unstripped
2008-06-06 16:08:04 +00:00
Denis Vlasenko
69dc325397 syslogd: do not error out on missing files to rotate. closes bug 3404. 2008-05-24 21:03:53 +00:00
Bernhard Reutner-Fischer
636a1f85e8 - use EXIT_{SUCCESS,FAILURE}. No object-code changes 2008-05-19 09:29:47 +00:00
Denis Vlasenko
6b06cb80be more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.

function                                             old     new   delta
syslogd_main                                         938     958     +20
get_signum                                           136     143      +7
obj_load                                             777     782      +5
recv_from_to                                         210     214      +4
get_next_block                                      1795    1799      +4
display_topmem_process_list                         1117    1121      +4
logread_main                                         484     487      +3
buffer_fill_and_print                                 73      76      +3
kill_main                                            687     689      +2
ll_remember_index                                    240     241      +1
do_stats                                             452     453      +1
if_readconf                                          166     165      -1
display_process_list                                1192    1191      -1
run_applet_and_exit                                  507     505      -2
print_signames                                        33      31      -2
parse_one_line                                      1092    1090      -2
find_out_spec                                         57      55      -2
add_ksymoops_symbols                                 421     419      -2
ash_main                                            1407    1402      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17)            Total: 37 bytes
2008-05-15 21:30:45 +00:00
Denis Vlasenko
4ee7cd4f6f *: mode tcp/udpsvd to networking, delete ipsvd/*
*/Config.in: fixes to text
svlogd: make it NOMMU capable

function                                             old     new   delta
processorstart                                       378     420     +42
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 42/0)               Total: 42 bytes
   text    data     bss     dec     hex filename
 797153     662    7420  805235   c4973 busybox_old
 797196     662    7420  805278   c499e busybox_unstripped
2008-03-17 09:13:22 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +00:00
Denis Vlasenko
be048f21e6 syslogd: optional support for dropping dups. closes bug 436. 2008-02-26 20:13:52 +00:00
Denis Vlasenko
6f1713f216 *: intrduce and use safe_gethostname. By Tito <farmatito AT tiscali.it>
safe_gethostname                                       -      48     +48
glob3                                                 35      37      +2
timestamp_and_log                                    314     315      +1
udhcp_send_kernel_packet                             234     231      -3
scan_tree                                            275     271      -4
passwd_main                                         1074    1070      -4
print_login_prompt                                    68      58     -10
obscure                                              392     377     -15
syslogd_main                                         882     866     -16
print_login_issue                                    516     478     -38
hostname_main                                        278     223     -55
parse_and_put_prompt                                 825     756     -69
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/9 up/down: 51/-214)          Total: -163 bytes
   text    data     bss     dec     hex filename
 798791     728    7484  807003   c505b busybox_old
 798631     728    7484  806843   c4fbb busybox_unstripped
2008-02-25 23:23:58 +00:00
Denis Vlasenko
400d8bb45e less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
*: minor shrink
2008-02-24 13:36:01 +00:00
Denis Vlasenko
a7259b64e8 syslogd: small shrink 2008-02-23 12:08:36 +00:00
Denis Vlasenko
84da0bf475 udhcp: make paths configurable
syslogd: trivial build fix
2008-02-20 22:29:52 +00:00
Denis Vlasenko
92657d484f syslogd: tighten up hostname handling. 2008-02-19 01:10:20 +00:00
Denis Vlasenko
cb448fe01b libbb: introduce and use xrename and rename_or_warn. 2008-02-17 14:28:53 +00:00
Denis Vlasenko
25591c322c libbb: introduce bb_signals and bb_signals_recursive,
which sets same handler for many signals. sig_catch is nuked
(bb_signals_recursive is more descriptive name).
*: use them as appropriate. 

function                                             old     new   delta
bb_signals_recursive                                   -      95     +95
bb_signals                                             -      52     +52
run_command                                          258     273     +15
svlogd_main                                         1368    1377      +9
runsv_main                                          1746    1752      +6
runsvdir_main                                       1643    1646      +3
UNSPEC_print                                          64      66      +2
time_main                                           1128    1127      -1
...
resize_main                                          246     210     -36
sig_catch                                             63       -     -63
set_fatal_sighandler                                  85      14     -71
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 5/24 up/down: 182/-548)        Total: -366 bytes
2008-02-16 22:58:56 +00:00
Denis Vlasenko
75cddd8eb5 syslogd: send '\n'-terminated messages over the network.
fully closes bug 1574. +8 bytes.
2008-02-13 09:19:14 +00:00
Bernhard Reutner-Fischer
8c69afd992 - be C99 friendly. Anonymous unions are a GNU extension. This change is
size-neutral WRT -std=gnu99 and fixes several compilation errors for strict
  C99 mode.
2008-01-29 10:33:34 +00:00
Bernhard Reutner-Fischer
f470196a41 - fix conflicting decls of syslog related facilitynames and prioritynames tables 2008-01-27 12:50:12 +00:00
Denis Vlasenko
4e9ca75281 syslogd: fix shmat error check 2008-01-07 15:58:02 +00:00
Denis Vlasenko
4dada747e5 syslogd: avoid excessive tine() system calls
function                                             old     new   delta
timestamp_and_log_internal                             -      24     +24
log_locally                                          741     744      +3
timestamp_and_log                                    313     314      +1
syslogd_main                                         904     897      -7
quit_signal                                          101      94      -7
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 28/-14)             Total: 14 bytes
2008-01-03 12:13:42 +00:00
Denis Vlasenko
4f2e8bc765 syslogd: don't die if remote host's IP cannot be resolved.
retry resolutions every two minutes instead.

function                                             old     new   delta
syslogd_main                                         865     904     +39
timestamp_and_log                                    324     313     -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 39/-11)             Total: 28 bytes
2008-01-03 12:12:27 +00:00
Denis Vlasenko
d2023283ac fix buglets found by randomconfig 2007-11-23 23:39:01 +00:00
Denis Vlasenko
e85dbae389 logread: add forgotten INIT_G(); 2007-11-23 03:41:20 +00:00
Denis Vlasenko
ff2b6d2185 logread: eliminate usage of data/bss
ifup: don't remove virtual iface prefixes (eth0:0)

function                                             old     new   delta
shbuf                                                  4       -      -4
SMrup                                                  6       -      -6
SMrdn                                                 12       -     -12
static.label_buf                                      20       4     -16
get_var                                              158     140     -18
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 0/2 up/down: 0/-56)             Total: -56 bytes
   text    data     bss     dec     hex filename
 783501     962    9260  793723   c1c7b busybox_old
 783483     942    9244  793669   c1c45 busybox_unstripped
2007-11-23 03:39:45 +00:00
Denis Vlasenko
70ab28f907 syslogd: use DEV_CONSOLE consistently
init: remove obsolete comment
2007-11-18 05:43:05 +00:00
Denis Vlasenko
7e3a5f58bc dmesg,klogd: make code more readable
libbb: explain why we declare klogctl
libbb: move defs around so that order makes more sense
2007-11-16 20:18:54 +00:00
Denis Vlasenko
d031b203c7 syslogd: support "symlink to symlink" for /dev/log; reduce stack usage
function                                             old     new   delta
create_socket                                          -     134    +134
syslogd_main                                        1132     865    -267
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 134/-267)         Total: -133 bytes
   text    data     bss     dec     hex filename
 775603     974    9420  785997   bfe4d busybox_old
 775445     974    9420  785839   bfdaf busybox_unstripped
2007-11-10 01:28:19 +00:00
Denis Vlasenko
cb12cb2407 modprobe: fix a bug where we were entering endless loop
syslogd: strip trailing '\n' too, not only NULs
2007-11-06 11:34:03 +00:00
Denis Vlasenko
018b155ad9 telnetd: fix problem with zombies (by Paul Fox <pgf@brightstareng.com>)
syslogd: strip trailing NULs
2007-11-06 01:38:46 +00:00
Denis Vlasenko
4f95e5aab8 vi: don't wait 50 ms before reading ESC sequences
inetd,syslogd: use safe_read instead of open-coded EINTR handling
syslogd: bail out if you see null read from Unix socket
(should never happen, but if it does, spinning forever
and eating 100% CPU is not a good idea)
2007-10-11 10:10:15 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
ebeaea04dc logger: fix a problem of losing all argv except first 2007-10-02 09:57:41 +00:00
Denis Vlasenko
d7ecd863c8 syslogd: do not need to poll(), we can just block in read().
function                                             old     new   delta
syslogd_main                                        1206    1106    -100
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-100)           Total: -100 bytes
   text    data     bss     dec     hex filename
 769820    1051   10764  781635   bed43 busybox_old
 769702    1051   10764  781517   beccd busybox_unstripped
2007-09-07 13:53:32 +00:00
Denis Vlasenko
87f3b26b3a *: replace select-for-one descriptor with poll, it's smaller.
$ ./.cmk bloatcheck
function                                             old     new   delta
readit                                               406     364     -42
syslogd_main                                        1249    1206     -43
traceroute_main                                     4115    4060     -55
mysleep                                              112      45     -67
arpping                                              579     441    -138
tftp                                                1575    1182    -393
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-738)           Total: -738 bytes
   text    data     bss     dec     hex filename
 770580    1051   10764  782395   bf03b busybox_old
 769820    1051   10764  781635   bed43 busybox_unstripped
2007-09-07 13:43:28 +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
a1120a8ea2 syslogd: set syslog IPC buffer to mode 0644 2007-08-14 10:27:56 +00:00
Denis Vlasenko
5f1b149d54 syslogd,logread: get rid of head pointer, fix logread bug in the process
function                                             old     new   delta
logread_main                                         450     462     +12
syslogd_main                                        1246    1252      +6
shbuf                                                  -       4      +4
buf                                                   34      30      -4
packed_usage                                       22729   22724      -5
log_locally                                          957     767    -190
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/3 up/down: 22/-199)          Total: -177 bytes
   text    data     bss     dec     hex filename
 773886    1116   11316  786318   bff8e busybox_old
 773714    1116   11316  786146   bfee2 busybox_unstripped
2007-08-12 21:33:06 +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
2ee028dd5b syslogd: do not convert tabs to ^I 2007-06-21 13:44:53 +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
Bernhard Reutner-Fischer
bb4b9f1fc9 - add a config-time range check for IPC_SYSLOG_BUFFER_SIZE
The upper-bound doesn't look like it is working since it accepts LONG_MAX as input. I suspect that this is an lxdialog feature or something like that ;)
2007-06-07 13:22:56 +00:00
Denis Vlasenko
3c8b5ba8e8 syslogd: move some vectors from data to text. Needs uclibc patch
to have any effect (patch is submitted to uclibc ml).

# size *[67]/*/syslog*.o
   text    data     bss     dec     hex filename
   3169     288       0    3457     d81 busybox.t6/sysklogd/syslogd.o
   3457       0       0    3457     d81 busybox.t7/sysklogd/syslogd.o
2007-06-04 18:23:59 +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
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
dd999a2241 klogd: remove dependency on syslogd 2007-05-02 21:39:29 +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
5a142025d3 move everything to new NOMMU helpers, except udhcp 2007-03-26 13:20:54 +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
4f93cde77f syslogd: fix it for small BUFSIZ case 2007-03-20 20:03:03 +00:00
Denis Vlasenko
5e892bae51 syslogd: reduce data/bss usage. Code size is practically the same. 2007-03-15 19:50:46 +00:00
Denis Vlasenko
c84520d73d klogd: code de-obfuscation with small code size reduction 2007-02-17 14:12:10 +00:00
Denis Vlasenko
4998c81891 syslogd: MARK code is buggy. Disabling it altogether on anti-bloat grounds 2007-02-14 20:51:46 +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
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
ab2aea4447 preparatory patch for -Wwrite-strings #4 2007-01-29 22:51:58 +00:00
Denis Vlasenko
218f2f4882 accumulated post-1.4.0 fixes 2007-01-24 22:02:01 +00:00
Denis Vlasenko
150f402b36 whitespace fixes (leading spaces to tab) 2007-01-13 21:06:21 +00:00
Denis Vlasenko
4df8135cf6 undo RESERVE_CONFIG_BUFFER change. aldot, small on-stack char[N] objects
are perfectly okay, don't convert them to RESERVE_CONFIG_BUFFERs.
2007-01-12 21:01:05 +00:00
Denis Vlasenko
085231fbba code shrinkage by Bernhard Fischer <rep.nop@aon.at> 2007-01-10 22:35:54 +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
1c962f23e0 Yet another small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:44:57 +00:00
Denis Vlasenko
59f2c34037 small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:43:28 +00:00
Denis Vlasenko
bae7948a5a small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:42:43 +00:00
Denis Vlasenko
db1edde6d8 compilation fix by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:39:48 +00:00
Bernhard Reutner-Fischer
0f48663f83 - shrink by 26 bytes or so 2007-01-09 17:37:32 +00:00
Bernhard Reutner-Fischer
8fc4011992 - shrink klogd a tiny bit.
Compile tested only, would have sent it to the list for review but they don't show up in the ML archives :-/
   text    data     bss     dec     hex filename
    533       0       0     533     215 sysklogd/klogd.o.orig
    530       0       0     530     212 sysklogd/klogd.o
2007-01-09 15:46:36 +00:00
Denis Vlasenko
8a820b2732 syslogs: a bit better wording in explanation how buffering
is allocated
2007-01-06 22:08:53 +00:00
Denis Vlasenko
a0e2a0a192 syslogd: start using bb_common_bufsiz1 instead of stack/malloc
logger: optimize, also use bb_common_bufsiz1 (~40 bytes)
tested to eat arbitrarily-sized input at high speed - ok
2007-01-04 21:22:11 +00:00
Denis Vlasenko
b893497151 syslogd: stop doing open/fstat/lseek/close on _every_ write
(still doing it if more than a second passed in between).
Costs ~40 bytes.
2007-01-04 18:02:32 +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
ceab8700df syslogd: almost rewritten. Had several obvious bugs... 2007-01-04 17:57:54 +00:00
Denis Vlasenko
e428e9d43b klogd: small optimizations
(btw, I looked into syslogd... that's frightening!)
2007-01-04 03:07:57 +00:00
Denis Vlasenko
b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +00:00
Denis Vlasenko
459903bd4e Provide our own isdigit macro. saves more than 400 bytes. 2006-11-27 14:44:18 +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
7d219aab70 build system overhaul 2006-10-05 10:17:08 +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
02be0f5350 syslogd: do not retry udp sends (can stall syslogd for extended periods
of time), resolve remote logging host before daemonization
2006-09-30 19:21:24 +00:00
Denis Vlasenko
14c1940255 syslogd: getopt_ulflags'ification (save ~50 bytes) 2006-09-30 19:20:00 +00:00
Denis Vlasenko
1decd0e529 syslogd: add option to suppress logging of messages lower than level N (-n N) 2006-09-30 19:17:40 +00:00
Denis Vlasenko
cb1ba86507 logger: getopt_ulflags'isation 2006-09-22 08:44:58 +00:00
Rob Landley
49ea46667f Build fixes for gcc 4.0 with -Werror, from Tito. 2006-09-11 01:34:21 +00:00
Denis Vlasenko
9cac521f07 using [xa]sprintf for string concatenation is neat and saves
~100 bytes according to bloatcheck. Also this fixes bug in rpm
2006-09-09 12:24:19 +00:00
Denis Vlasenko
bd8f43dbab few random readability enhansements. No code changes 2006-09-08 17:31:55 +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
Rob Landley
88621d7398 Svn 16007 broke the build under gcc 4.0.3. This fixes up some of the damage
(the e2fsprogs directory is too twisty and evil to easily fix, but I plan
to rewrite it anyway so I'll just bump that up in priority a bit).
2006-08-29 19:41:06 +00:00
Rob Landley
028ba280be More allbareconfig fixes. 2006-08-28 20:16:42 +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
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
"Robert P. J. Day"
eea561871b "formated" -> "formatted" throughout the code base. 2006-07-20 19:02:24 +00:00
Bernhard Reutner-Fischer
e15d7573a1 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-02 20:56:16 +00:00
Bernhard Reutner-Fischer
d04e9b8130 - shrink logread a bit.
text    data     bss     dec     hex filename
    862      26     188    1076     434 logread.o.orig
    825      26     188    1039     40f logread.o
2006-06-01 14:36:14 +00:00
Bernhard Reutner-Fischer
595159f38c - shrink klogd a bit
text    data     bss     dec     hex filename
    569       0       0     569     239 sysklogd/klogd.o.orig
    537       0       0     537     219 sysklogd/klogd.o
2006-05-31 12:22:13 +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
Bernhard Reutner-Fischer
b1629b1b2a - remove emacs layout block as suggested by Robert P.J. Day
- use shorter boilerplate while at it
2006-05-19 19:29:19 +00:00
Mike Frysinger
39440e520c pull Rules.mak from top_srcdir as pointed out by Robert P. J. Day on the mailing list 2006-05-13 02:33:09 +00:00
Bernhard Reutner-Fischer
0c013f5fc7 - commentary typo and superfluous whitespace removal in weird messages. 2006-04-18 12:46:56 +00:00
Rob Landley
2ec922eed5 Patch from Robert P Day: let menuconfig indent stuff for us, we don't have
to do it in Config.in.
2006-04-13 23:22:16 +00:00
Bernhard Reutner-Fischer
2c99851181 - patch from Denis Vlasenko to add and use bb_xdaemon() 2006-04-12 18:09:26 +00:00
Bernhard Reutner-Fischer
dac7ff15b7 - patch from Denis Vlasenko to add and use bb_xsocket() and to use
bb_xopen some more while at it.
  Also use shorter boilerplate while at it.
2006-04-12 17:55:51 +00:00
Bernhard Reutner-Fischer
df10094870 - revert back to r14406 2006-03-13 19:04:00 +00:00
Bernhard Reutner-Fischer
07a79e75f5 - backout using features which are not available with the previous stable
version of make (3.71.1).
2006-03-09 09:03:37 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Bernhard Reutner-Fischer
022eb311d5 - use absolute path for top_builddir and top_srcdir.
Fixes make trying to include the very same file in an endless loop.
2006-03-02 17:33:25 +00:00
Bernhard Reutner-Fischer
5d26126b9e - fixes parallel builds (make -j)
- use less resources for the buildsystem itself
2006-03-01 22:54:48 +00:00
Rob Landley
d6e14d8bee Don't build directory libraries unless we're building an applet that needs it.
Cherry-picked from Devin Bayer's big MacOS X patch.
2006-02-21 19:11:35 +00:00
"Vladimir N. Oleynik"
dd1ccddf1b moved BB_BANNER to applets/version.c file: make kernel like version,
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-02-16 15:40:24 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer
86f5c9906b - add platform.h.
- use shorter boilerplate while at it.
2006-01-22 22:55:11 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
Rob Landley
10fb2b71f3 Flush output to log promptly (bug 389). 2005-12-12 07:04:59 +00:00
"Vladimir N. Oleynik"
d3d829aaf0 20 bytes data to bss 2005-10-15 14:24:01 +00:00
"Vladimir N. Oleynik"
b32b1db9d8 complex RESERVE_CONFIG_BUFFER --> bb_common_bufsiz1 2005-10-15 13:49:21 +00:00
Bernhard Reutner-Fischer
bb66a6c94e - initialize the correct variables 2005-10-13 10:24:44 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
"Vladimir N. Oleynik"
e4baaa2d27 more remove lost exported 2005-09-22 12:59:26 +00:00
Bernhard Reutner-Fischer
d5bd137a24 - rename libbb's password helpers as suggested in libbb.h
my_getpwnam -> bb_xgetpwnam  /* dies on error */
  my_getgrnam -> bb_xgetgrnam  /* dies on error */
  my_getgrgid -> bb_getgrgid
  my_getpwuid -> bb_getpwuid
  my_getug    -> bb_getug
2005-09-20 21:06:17 +00:00
Rob Landley
570f655ee4 Cleanup patch from tito: migrate option parsing to the bb_ functions and fix
types.
2005-09-14 15:36:52 +00:00
Eric Andersen
2c6b41812f Kunihiko IMAI writes:
We're using busybox and thank the authors.

I found a short buffer allocation at busybox/sysklod/syslod.c.  It
mis-declares length of filenames, seems to forget for '\0' or two
column numbered suffix of backup files (ex. messages.10).

Here is a patch for the problem.

Thanks.
2005-09-12 19:16:11 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Paul Fox
27cbffddd8 applying fix for:
0000143: sysklogd remote logging adds a space between facility and tag
2005-07-20 18:02:11 +00:00
Mike Frysinger
f547d672cf fix typoe (buildddir -> builddir) 2005-04-21 01:49:05 +00:00
Peter Kjellerstedt
c089ccdb44 Removed the incorrect and confusing facility argument specified with
openlog() as the correct facility will be specified with syslog()
anyway.
2005-04-06 10:56:57 +00:00
Eric Andersen
7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Glenn L McGrath
73ebb889da Patch by Felipe Kellermann, fix a bug introduced in the last patch by adding a condition around the remote logging, also adds some comments. 2004-09-14 18:12:13 +00:00
Eric Andersen
f91b9282a3 Felipe Kellermann writes:
The Togg's sysklogd patch to use sendto() on remote logging is formatting
strangely (using `<' and '>' surrounding the `msg' string message).  This
is OK, but this is not the standard way of formatting this message.

So this patch does the following:

o Fix the formatting to the standard way.
o Uses `MAXLINE' when needed;
o Don't loop sending messages without a "sleeping time",
  I'm now doing `now = 1', `now <<= 1';
o Don't die on `init_RemoteLog' when starting up (feature!)
  We're now trying to connect every time we have an invalid fd;
o Removes one static uneeded variable.
o Removes two automatic uneeded variables.
2004-09-08 10:56:06 +00:00
Eric Andersen
192c35f6eb Tito writes:
The second patch contains:
1) a size optimization for adduser.c
2) removes a warning about an unused variable in syslogd.c if CONFIG_FEATURE_REMOTE_LOG is not set
3)cosmetic fixes for addgroup_full_usage and adduser_full_usage

Ciao,
Tito
2004-09-02 22:22:17 +00:00
Eric Andersen
75813eea23 Togg writes:
Syslogd wont start if remote-logging is enabled and the connection to the
remote-log server is not possible on syslogd startup.

I found a patch somewhere which works like a charm. It uses sendto() which
seems more reliable for this issue.

Please see attached patch. Many people will be more happy with this included
I think.

Regards,
Togg
2004-08-26 23:15:29 +00:00
Eric Andersen
52499cb9ae Tito writes:
Hi,
I've spent the half night staring at the devilish  my_getpwuid and my_getgrgid functions
trying to find out a way to avoid actual and future potential buffer overflow problems
without breaking existing code.
Finally I've  found a not intrusive way to do this that surely doesn't break existing code
and fixes a couple of problems too.
The attached patch:
1) changes the behaviour of my_getpwuid and my_getgrgid to avoid potetntial buffer overflows
2) fixes all occurences of this function calls in tar.c , id.c , ls.c, whoami.c, logger.c, libbb.h.
3) The behaviour of tar, ls and  logger is unchanged.
4) The behavior of ps with somewhat longer usernames messing up output is fixed.
5) The only bigger change was the increasing of size of the buffers in id.c to avoid
     false negatives (unknown user: xxxxxx) with usernames longer than 8 chars.
     The value i used ( 32 chars ) was taken from the tar header ( see gname and uname).
     Maybe this buffers can be reduced a bit  ( to 16 or whatever ), this is up to you.
6) The increase of size of the binary is not so dramatic:
     size busybox
       text    data     bss     dec     hex filename
     239568    2300   36816  278684   4409c busybox
    size busybox_fixed
       text    data     bss     dec     hex filename
     239616    2300   36816  278732   440cc busybox
7) The behaviour of whoami changed:
    actually it  prints out an username cut down to the size of the buffer.
    This could be fixed by increasing the size of the buffer as in id.c or
    avoid the use of my_getpwuid and use getpwuid directly instead.
    Maybe this colud be also remain unchanged......

Please apply if you think it is ok to do so.
The diff applies on today's cvs tarball (2004-08-25).
Thanks in advance,
Ciao,
Tito
2004-08-26 22:18:59 +00:00
Glenn L McGrath
12ed333714 Part of patch from William Barsse, fixes a problem with unescaped %. 2004-08-06 00:58:53 +00:00
Glenn L McGrath
5529b7bb87 Reverse my previous change, "::" is a GNU getopt extension that allows
an optional argument.
Looks like a glibc bug to me
2004-07-22 04:23:18 +00:00
Glenn L McGrath
e8f46515cb Fix bug in accepting buffer size argument 2004-07-21 13:06:30 +00:00
Eric Andersen
0373cf1396 Do not mess with the console logging level unless
asked to do so.
 -Erik
2004-06-25 11:23:03 +00:00
Eric Andersen
bb692cdb32 Add missing 'S' to the getopt string. 2004-06-22 19:05:05 +00:00
Eric Andersen
7f94a5caa2 Patch from Bastian Blank:
Hi folks

    The following patch adds a new log message output to syslogd. This
    output omits hostname and priority and is used in d-i to make the syslog
    output better readable without lossing information.

    Bastian

I am applying this since I have syslogd hacked up in my wife's
access point with the same format string....  Might as well make
this hack official.
 -Erik
2004-06-22 10:12:59 +00:00
Eric Andersen
36adca81f5 Patch from Bastian Blank:
On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote:
> The following patch changes klogd to use openlog/syslog themself
> instead of calling syslog_msg which always calls the triple
> openlog/syslog/closelog.

Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen.

Bastian
2004-06-22 10:07:17 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Glenn L McGrath
df2c56529c Fix from Paul Kortekaas for syslog -C option, size should be in kB. 2004-02-22 12:17:33 +00:00
Eric Andersen
d4a5e255c4 Patch from Fillod Stephane:
You will find in the attached file "syslog.patch" a patch which adds
  config options to set at compile time the size of the circular buffer,
  and some documentation update.
2003-12-19 11:32:14 +00:00
Russ Dill
a1fece2c70 Get vfork_daemon_rexec working under uclinux 2003-12-15 21:57:44 +00:00
Eric Andersen
88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Eric Andersen
29c77f71ba Arnd Ben Otto writes:
Hi Eric

I have written a small patch for the Busybox syslogd. With this patch
one can limit the size of the messagfile. As soon as the limit is
reached the syslogd can rotate or purge the messagefile(s) on his own.
There is no necessity to use an external rotatescript.

Even if logread does something similar, its very handy to have some
messagefile after your box crash.

I wrote this patch initial vor BB 0.6x where no cron daemon was avail.
Now I adapted it for the new Version and i hope it is still useful. At
least I still use it :-)

bye
Arnd
2003-10-09 09:43:18 +00:00
Glenn L McGrath
f7dd10f67c Patch from Fillod Stephane
Add follow mode to logread, ala "tail -f /var/log/messages"
Note: output to a slow serial terminal can have side effects
on syslog because of the semaphore. In such case, define 
RC_LOGREAD.
2003-09-26 01:03:16 +00:00
Glenn L McGrath
a79220db6e add size parameter to syslogd -C
Patch by Padraig, resubmitted by Fillod Stephane
2003-09-26 00:49:05 +00:00