Commit Graph

255 Commits

Author SHA1 Message Date
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