Commit Graph

12641 Commits

Author SHA1 Message Date
Denys Vlasenko
c531b9a3e4 bzcat: fix unpacking of more than one file, and unpacking of zero-size bz2. Closes 4393
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 01:05:16 +01:00
Denys Vlasenko
b076193f74 modinfo: make it select PLATFORM_LINUX. Closes 4411
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-30 22:07:36 +01:00
Denys Vlasenko
e504c245f7 getty: Hurd has no CBAUD, work around that
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-30 21:27:33 +01:00
Denys Vlasenko
83e34ac4b5 makemime: fix -a option not taking parameter
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 18:25:38 +02:00
Christian Engelmayer
8de2e42201 syslogd: work around rename() not renaming hardlinks to themselves
Function log_locally() within the syslogd can potentially lock up when
restarting the daemon after a power loss in case the unplanned shutdown hit the
rename operation during logfile rotation.

While POSIX requires the rename operation to be atomic, many file systems such
as JFFS2 implement the rename operation in 2 steps by linking the new name
followed by unlinking the original name. In case of a power loss during the
rename the system can end up with /var/log/messages and /var/log/messages.0
being 2 hard links to the same file.

When the syslog daemon restarts in such a situation it will rediscover the need
to rotate the log files, however, POSIX also requires that rename does nothing
and reports success in case oldpath and newpath are existing hard links to the
same file. Looping through reopen: by (O_CREAT | O_APPEND), the daemon
eternally reopens the same file without succeeding to rotate.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 18:12:42 +02:00
Denys Vlasenko
e6094d95b5 libbb: shrink base64 decoding a bit
function                                             old     new   delta
bb_uuenc_tbl_base64                                   67      66      -1
decode_base64                                        182     161     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 16:15:00 +02:00
Denys Vlasenko
73d249e704 whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 14:07:44 +02:00
Leonid Lisovskiy
328f27fe44 libbb: split decode_base64 off read_base64
function                                             old     new   delta
decode_base64                                          -     182    +182
read_base64                                          378     255    -123
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 182/-123)           Total: 59 bytes

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 13:59:55 +02:00
Denys Vlasenko
ec447c7f01 libbb.h: remove unused defines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-24 04:06:18 +02:00
Denys Vlasenko
e9dc354df8 getty: fix a minor problem of Ctrl-D not printing '\n'
Also removed defines for control chars which are never changed,
and added login/getty README.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 23:58:59 +02:00
Denys Vlasenko
ee320c6d9c getty: reset tty attrs on Ctrl-C and Ctrl-D too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 18:05:58 +02:00
Denys Vlasenko
e206a4de4c getty: add O_NONBLOCK to open which is used to drop ctty
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 08:19:42 +02:00
Denys Vlasenko
a241069004 remove duplicate include <sys/swap.h>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:39:00 +02:00
Denys Vlasenko
94354154c4 getty: remove now not needed resetting of ALRM to to SIG_DFL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:30:48 +02:00
Denys Vlasenko
7449e18190 getty,login: tighten up handling of ctty, pgrp, and tty attr restoring on timeout
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:27:41 +02:00
Denys Vlasenko
ef5a2d757a getty: shrink help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 03:16:23 +02:00
Denys Vlasenko
5dd1f472a4 stty: trim too verbose error messages (-40 bytes)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-21 19:45:13 +02:00
Denys Vlasenko
17fb598dc2 docs/ctty.htm: add a useful URL to
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-21 18:44:33 +02:00
Denys Vlasenko
2af2acf9b5 udhcpc: add comment about server IP
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 14:47:41 +02:00
Denys Vlasenko
fbca0c68a7 udhcpc: in fill_envp, export BOOTP fields first
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 14:24:18 +02:00
Denys Vlasenko
cd4d78f525 dhcpc: fix the case where we might add extra space at the end of envvar.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 13:21:55 +02:00
Denys Vlasenko
1dff672335 udhcpc: fix 6rd option formatting (was using 4 more bytes than there is)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 12:29:18 +02:00
Denys Vlasenko
42816c204d udhcpc: remove unused argument in sprint_nip6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 10:52:07 +02:00
Denys Vlasenko
7981d79ef0 udhcpc: small code shrink
function                                             old     new   delta
udhcp_recv_raw_packet                                430     425      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 10:34:05 +02:00
Denys Vlasenko
f461385521 typo fix in comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 08:54:16 +02:00
Denys Vlasenko
1f56e51ca1 udhcpc: add support for DHCP option 212 (RFC 5969)
The patch is from OpenWRT people.

function                                             old     new   delta
xmalloc_optname_optval                               637     874    +237
dhcp_option_strings                                  237     243      +6
dhcp_optflags                                         68      70      +2
len_of_option_as_string                               12      13      +1
dhcp_option_lengths                                   12      13      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 247/0)             Total: 247 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:40:35 +02:00
Denys Vlasenko
2ea73b513d nc: small code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:31:01 +02:00
Denys Vlasenko
4ea37d62c2 gen_build_files.sh: simplify "print everything up to INSERT line" part
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 21:17:20 +02:00
Denys Vlasenko
efd08bfa0a gen_build_files: don't pass 200k+ strings as params. Closes 4321
Also removes one grep per generated file.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 17:54:42 +02:00
Denys Vlasenko
f74f280a14 get_header_tar: shrink 6->64 sign extension code
function                                             old     new   delta
getOctal                                             125     107     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 14:51:12 +02:00
Denys Vlasenko
9c28fb8d28 ifupdown: code shrink
function                                             old     new   delta
keywords_up_down                                       -      43     +43
set_environ                                          371     259    -112
ifupdown_main                                       2194    2073    -121
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 43/-233)          Total: -190 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:37:08 +02:00
Peter Korsgaard
dd82443b92 ifupdown: support post-up / pre-down hooks
function                                             old     new   delta
set_environ                                          330     371     +41
ifupdown_main                                       2156    2194     +38
iface_up                                              97     113     +16
iface_down                                            97     113     +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 111/0)             Total: 111 bytes

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:35:54 +02:00
Denys Vlasenko
ce8c4cf37f TODO: all another location with bbox patches (OpenWRT)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 01:55:08 +02:00
Denys Vlasenko
5f92043c3f uudecode: fix buggy check for empty filename
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 12:07:05 +02:00
Vladislav Grishenko
6464f15ddb udhcpc: on SIGUSR1, limit renew attempts time to 20 seconds; then do total reconfig
Scenario:

1. udhcpc gets lease for 86400 secs and sleeps for 43200 before renew attempt

2. PC gets physically disconnected and connected to another network

3. some phy control software sends SIGUSR1 to renew the lease, SIGUSR2 isn't
used because newly connected network could be the same as before

4. udhcpc sends unicast renew requests until lease timeout fall to 60 sec.
They are ignored by new network dhcp servers

5. udhcpc sends broadcast rebind requests for 60 seconds, which are NAKed
or ignored too

6. udhcpc deconfigs and starting from discover state, gets new lease for the
new network

So, pt.4+5 it could take up to 86400 secs without correct lease, which is
too long and not acceptable.

Second SIGUSR1 will immediately run into deconfig/discover state, which is
not preferable in case of the same subnet replugged.

This patch makes sure after SIGUSR1 timeout is no more than -A NUM
(usually 20 sec). It means that renew will be requested via broadcast,
and if no replies come back, full deconf/reconf cycle will be initiated
in 20 seconds.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 01:37:47 +02:00
Leonid Lisovskiy
6c9c0a1dc9 udhcp: IF_UDHCP_VERBOSE() macro - improve code readability
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 00:35:47 +02:00
Peter Korsgaard
cd06e06eee fbsplash: support 8bit mode
Fake truecolor support using a RGB:332 palette.

function                                             old     new   delta
fb_setpal                                              -     172    +172
fbsplash_main                                        920     953     +33
fb_pixel_value                                        50      80     +30
fb_write_pixel                                        47      51      +4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 239/0)             Total: 239 bytes

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-17 05:31:52 +02:00
Peter Korsgaard
e4fa7b7965 fbsplash: limit progress bar flicker
Progress bar updates flicker quite a bit on slow hw / high resolutions
as the background is completely cleared before the new progress bar
position is drawn on top.

Improve it by first drawing the progress bar and then only fill the
remaining rows with the background.

function                                             old     new   delta
fb_drawprogressbar                                   444     429     -15

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-17 04:35:23 +02:00
Denys Vlasenko
4c77ad75b1 pwd: implement -LP if DESKTOP
function                                             old     new   delta
pwd_main                                              41     244    +203

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-16 05:16:50 +02:00
Flemming Madsen
ecccbac37b inotify: if PROG is -, print events to stdout
function                                             old     new   delta
inotifyd_main                                        516     589     +73
packed_usage                                       28698   28709     +11

Signed-off-by: Flemming Madsen <busybox@themadsens.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-10 20:24:02 +02:00
Rob Landley
39ec6a2ad5 patch: make -p count path components, not slashes (think /blah//thing)
Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-10 19:59:38 +02:00
Oliver Metz
cc87588a61 disable strverscmp usage if we build against uClibc-0.9.31
Signed-off-by: Oliver Metz <oliver.metz@googlemail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-09 02:08:42 +02:00
Denys Vlasenko
faf7c62f1d tftp: mode string is case independent
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-06 17:19:09 +02:00
Cristian Ionescu-Idbohrn
85b1f292c9 ps: fix for !FEATURE_PS_LONG build
Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-29 11:02:00 +02:00
Flemming Madsen
b64bd16459 ps: with -l, show STIME too
Signed-off-by: Flemming Madsen <busybox@themadsens.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-27 15:31:25 +02:00
Denys Vlasenko
8d9ac30572 ps: add support for -l for !DESKTOP
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-26 02:56:08 +02:00
Denys Vlasenko
d184a728cf rename archive.h to bb_archive.h. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-22 12:45:14 +02:00
Denys Vlasenko
45f0a1156d mdev: trim overlong comments. No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-22 04:55:47 +02:00
Denys Vlasenko
3eccd7ecbe mdev: don't reparse rules on -s
function                                             old     new   delta
make_device                                         1648    1843    +195
clean_up_cur_rule                                      -      61     +61
make_default_cur_rule                                  -      41     +41
mdev_main                                            690     712     +22
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/0 up/down: 319/0)             Total: 319 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-22 03:46:30 +02:00
Denys Vlasenko
16714245f9 add INIT_G()'s. No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-21 01:59:15 +02:00