Commit Graph

1714 Commits

Author SHA1 Message Date
Denys Vlasenko
7b276fc175 kill[all[5]],pkill: more correct, and smaller, SIGRTMIN/MAX code
function                                             old     new   delta
__libc_current_sigrtmin                                6       -      -6
__libc_current_sigrtmax                                6       -      -6
get_signum                                           339     295     -44
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 0/1 up/down: 0/-56)             Total: -56 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-01-03 12:51:13 +01:00
Denys Vlasenko
92ffe0571a date,touch: treat 2-digit years better (fit them into +-50 yrs around today)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-02 20:02:09 +01:00
Denys Vlasenko
2753aae0e8 libbb: optionally support RTMIN[+n] and RTMAX[-n] signal names
function                                             old     new   delta
get_signum                                           140     336    +196
__libc_allocate_rtsig                                  -      56     +56
__libc_current_sigrtmin                                -       6      +6
__libc_current_sigrtmax                                -       6      +6
current_rtmin                                          -       4      +4
current_rtmax                                          -       4      +4
bbconfig_config_bz2                                 4961    4962      +1
------------------------------------------------------------------------------
(add/remove: 6/0 grow/shrink: 2/0 up/down: 273/0)             Total: 273 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-30 01:17:03 +01:00
Denys Vlasenko
2272129a93 plug a DIR* leak on error path
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-28 10:25:03 +01:00
Lauri Kasanen
6578f2cf5b pstree: new applet. +1664 bytes
text    data     bss     dec     hex filename
 883379     936   17192  901507   dc183 busybox_old
 885043     936   17192  903171   dc803 busybox_unstripped

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-05 05:22:29 +01:00
Denys Vlasenko
a04440ccad typo fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-05 05:02:49 +01:00
Denys Vlasenko
8da415ef25 add if guards around include <malloc.h>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-05 01:30:14 +01:00
Denys Vlasenko
5dcc6606cb libbb/pw_encrypt_sha: forgot to move &ctx to 1st param here in sha hash rework
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-12-01 13:57:25 +01:00
Denys Vlasenko
0ab45da929 exclude the case of just "busybox" from previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-29 03:21:55 +01:00
Denys Vlasenko
8f0af3b001 if only one applet is enabled, make "busybox applet [params]" work as expected
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-29 02:55:35 +01:00
Denys Vlasenko
26777aa1c6 fixes for bugs discovered by randomconfig builds and tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-22 23:49:10 +01:00
Denys Vlasenko
29ca159133 fix misspelling in comment
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-11-22 18:13:15 +01:00
Mike Shal
f3763033e4 lineedit: fix tab-completion of filenames with spaces
Using ash in busybox git version dea28e1e, tab completion doesn't seem
to work properly for filenames that have special characters (such as
spaces) in them. For example, with filenames "foo bar" and "foo zap",
typing "ls fo<TAB>" correctly expands to "ls foo\ ", but then
continuing to type "b<TAB>" will produce "ls foo\ bbar", which is not
correct (the 'b' is duplicated).

Signed-off-by: Mike Shal <marfey@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-22 03:49:18 +01:00
Wolfram Sang
2e9aeae4db lineedit: create history files with mode 0600
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-15 02:58:28 +01:00
Lauri Kasanen
2b662c5dec libbb: remove unused variable
Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-13 23:16:05 +01:00
Denys Vlasenko
854738d39d type fix in comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-03 02:48:43 +01:00
Denys Vlasenko
833d4e7f84 rename archival/libunarchive -> archival/libarchive; move bz/ into it
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-03 02:38:31 +01:00
Denys Vlasenko
fb132e4737 whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-29 11:46:52 +02:00
Denys Vlasenko
6b3f0b0dab unicode: update unicode_width on !unicode branch too. Closes bug 2593
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-29 00:50:09 +02:00
Denys Vlasenko
caddfc8339 decompress_bunzip2: handle concatenated .bz2 files
function                                             old     new   delta
unpack_bz2_stream                                    207     307    +100
start_bunzip                                         199     209     +10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 110/0)             Total: 110 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 23:08:53 +02:00
Marek Polacek
7b18107384 *: use _exit() in sighandlers; showkey: do not use exit-thru-sighandler
While at it, make ESC sequences more readable; and removed check for
isatty(stdin) in reset. Code shrink:

   text    data     bss     dec     hex filename
 884771     936   17216  902923   dc70b busybox_old
 884723     936   17216  902875   dc6db busybox_unstripped

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 21:34:56 +02:00
Denys Vlasenko
e4dcba1c10 *: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 18:57:19 +02:00
Denys Vlasenko
16cc80e989 crc32: cleanups, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 05:38:11 +02:00
Denys Vlasenko
9ce642f974 libbb: introduce and use common crc32 routine
function                                             old     new   delta
crc32_block_endian1                                    -      37     +37
crc32_block_endian0                                    -      34     +34
global_crc32_table                                     -       8      +8
file_read                                             82      87      +5
gzip_main                                            211     214      +3
xz_crc32                                              40      35      -5
crc32_table                                            8       -      -8
calculate_gunzip_crc                                  54      34     -20
lzo_crc32                                             54      25     -29
cksum_main                                           298     211     -87
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/4 up/down: 87/-149)           Total: -62 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-27 15:26:45 +02:00
Denys Vlasenko
a2d27a1919 libbb/process_escape_sequence.c: fix recently broken handling of \\
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-25 12:14:21 +02:00
Marek Polacek
b507cc3ace powertop: new applet
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-25 03:44:34 +02:00
Kevin Cernekee
ccb070450e fdisk: initial stab at GPT partition support
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-25 02:00:24 +02:00
Denys Vlasenko
03a5fe378e sha1: small tweak for clearer code, no logic changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 20:51:28 +02:00
Denys Vlasenko
f4c93ab304 sha1: use Rob's code, it's smaller and faster
function                                             old     new   delta
static.rconsts                                         -      16     +16
sha1_process_block64                                 460     298    -162
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 16/-162)          Total: -146 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 19:27:30 +02:00
Denys Vlasenko
2b299fed6a awk: fix breakage in last commit
While at it, made bb_process_escape_sequence faster (same size)

function                                             old     new   delta
nextchar                                              49      53      +4
bb_process_escape_sequence                           138     140      +2
next_token                                           838     839      +1
static.charmap                                        20      18      -2
is_assignment                                        143     135      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 7/-10)              Total: -3 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 01:58:04 +02:00
Denys Vlasenko
5360059131 libbb: introduce and use strcpy_and_process_escape_sequences
function                                             old     new   delta
strcpy_and_process_escape_sequences                    -      50     +50
bb_process_escape_sequence                           148     138     -10
printf_main                                          789     776     -13
getty_main                                          1897    1831     -66
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 50/-89)            Total: -39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-23 21:06:06 +02:00
Alexander Shishkin
6722737ece *: introduce and use xmkstemp. -65 bytes.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22 13:27:16 +02:00
Denys Vlasenko
0016bcee37 klogd: do not log partial lines
function                                             old     new   delta
overlapping_strcpy                                    15      18      +3
klogd_main                                           438     436      -2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-19 23:07:49 +02:00
Denys Vlasenko
7ab94ca351 md5: remove outdated comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-19 02:33:39 +02:00
Denys Vlasenko
302ad1450e libbb/hash_md5_sha: use common ctx and code for md5 and sha1/256
function                                             old     new   delta
sha256_process_block64                               421     433     +12
md5_crypt                                            578     587      +9
md5_begin                                             43      50      +7
md5_hash                                              99      97      -2
sha1_end                                              85      82      -3
md5_end                                               36      31      -5
common64_end                                          93      86      -7
sha1_hash                                             97       -     -97

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-19 02:16:12 +02:00
Denys Vlasenko
c48a5c607d hash_md5_sha: use common finalization routine for MD5 and sha1/256. -15 bytes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 14:48:30 +02:00
Denys Vlasenko
b5aa1d95a1 libbb/hash_sha.c -> libbb/hash_md5_sha.c
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 13:47:47 +02:00
Denys Vlasenko
eb7fe6dbf5 libbb: move md5 and shaN into a common source file. no code changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 13:46:07 +02:00
Denys Vlasenko
e08ef581af md5: length should be stored in *little-endian* order! fixing...
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 11:50:17 +02:00
Denys Vlasenko
9ff50b8697 *: deinline SWAP_xE64 on 32-bit CPUs. Wins !90 bytes both on 32 and 64 bits
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 11:40:26 +02:00
Denys Vlasenko
b102e12253 *: use SWAP_BE64 instead of open-coding it
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 11:39:47 +02:00
Denys Vlasenko
06f719fd79 libbb: rename hash source files. no code changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 10:38:18 +02:00
Denys Vlasenko
c05387d5de *: replace xopen3 with xopen where makes sense
function                                             old     new   delta
uniq_main                                            421     416      -5
sort_main                                            803     798      -5
patch_main                                          2051    2046      -5
cpio_main                                            547     542      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-18 02:38:27 +02:00
Denys Vlasenko
b8d02597e3 md5: fix biuld failure on big-endian machines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 23:01:32 +02:00
Denys Vlasenko
cfe114c4f3 md5: code shrink -5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 11:38:44 +02:00
Denys Vlasenko
f6dacc23ff bring md5 and sha1 names closer. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 03:21:51 +02:00
Denys Vlasenko
36ab585f68 md5: code shrink
function                                             old     new   delta
md5_end                                              125     104     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 03:00:36 +02:00
Denys Vlasenko
a971a192e8 shaN: code shrink
function                                             old     new   delta
init512_lo                                            32      40      +8
init256                                               32      40      +8
sha256_begin                                          42      28     -14
sha512_begin                                          81      53     -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 16/-42)            Total: -26 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 01:35:16 +02:00
Denys Vlasenko
446c2349b6 whitespace fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-16 23:39:43 +02:00
Denys Vlasenko
4bc3b85894 sha512: inline rotr64
function                                             old     new   delta
sha1_process_block64                                 461     446     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-16 23:31:15 +02:00