Commit Graph

359 Commits

Author SHA1 Message Date
Denis Vlasenko
5c3d2b334a ash: readability enhancement, no code changes 2008-02-03 22:01:08 +00:00
Denis Vlasenko
36fc3cd8bc ash: code readability enhancements, no real code changes 2008-01-29 09:23:49 +00:00
Denis Vlasenko
847fa779af *: tidy up usage of char **environ 2008-01-28 22:45:43 +00:00
Denis Vlasenko
fb0eba706c libbb: introduce and use safe_waitpid (loops in EINTR)
*: use more approproate (shorter) versions of wait()

function                                             old     new   delta
safe_waitpid                                           -      48     +48
wait_any_nohang                                        -      17     +17
send_tree                                            365     369      +4
processorstop                                        432     435      +3
text_yank                                            110     108      -2
make_human_readable_str                              202     200      -2
crond_main                                          1368    1366      -2
handle_sigchld                                        49      43      -6
reapchild                                            166     159      -7
custom                                               260     250     -10
checkscript                                          191     177     -14
wait_nohang                                           17       -     -17
wait_pid                                              43       -     -43
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103)           Total: -31 bytes
2008-01-02 19:55:04 +00:00
Denis Vlasenko
ee87ebf381 fix buglets found by randomconfig 2007-12-21 22:18:16 +00:00
Denis Vlasenko
0163111325 ash: reduce global data/bss usage
(add/remove: 4/29 grow/shrink: 76/21 up/down: 1007/-1713)    Total: -706 bytes
   text    data     bss     dec     hex filename
 777206    1084    8976  787266   c0342 busybox_old
 778077     908    7568  786553   c0079 busybox_unstripped
2007-12-16 17:20:38 +00:00
Denis Vlasenko
9cb220be9d lineedit: don't violate API if we do simple fgets
ash: cosmetic style fixes, no code changes
2007-12-09 10:03:28 +00:00
Denis Vlasenko
1aa7e477b1 reorganize applet table. Eliminates pointers to names.
Should be a big win for libbusybox. busybox wins too:

   text    data     bss     dec     hex filename
 776524     929    9100  786553   c0079 busybox_old
 775903     929    9100  785932   bfe0c busybox_unstripped
2007-11-28 06:49:03 +00:00
Denis Vlasenko
ed270a5f32 ash: make code simpler, and do not do close(-1) - it's rude 2007-11-26 05:37:07 +00:00
Denis Vlasenko
fe5e23bf75 remove echo_main -> bb_echo indirection 2007-11-24 02:23:51 +00:00
Denis Vlasenko
7d75a96b15 ash: fix bug where redirection of closed fd was leaving it open afterwards.
redirect                                             983    1024     +41
bb_echo                                              276     301     +25
popredir                                             118     132     +14
evalcommand                                         1163    1176     +13
bbunpack                                             358     366      +8
echocmd                                               13       5      -8
echo_main                                             13       5      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/2 up/down: 101/-16)            Total: 85 bytes
   text    data     bss     dec     hex filename
 774999     962    9236  785197   bfb2d busybox_old
 775084     962    9236  785282   bfb82 busybox_unstripped
2007-11-22 08:16:57 +00:00
Denis Vlasenko
a59f435b5f ash: if tcgetattr(stdin) fails, don't mess with tcsetattr
ash: size-optimize ulimit's table of limits

   text    data     bss     dec     hex filename
 777345     974    9676  787995   c061b busybox_old
 777253     974    9676  787903   c05bf busybox_unstripped
2007-10-29 19:17:29 +00:00
Denis Vlasenko
037576d77b read_line_input: fix it to not do any fancy editing if echoing is disabled.
ash: make read handling both more correct and smaller

read_line_input                                     4037    4101     +64
input_backward                                       140     139      -1
readcmd                                             1079    1070      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 65/-10)             Total: 54 bytes
   text    data     bss     dec     hex filename
 777575    1000    9532  788107   c068b busybox_old
 777629    1000    9532  788161   c06c1 busybox_unstripped
2007-10-20 18:30:38 +00:00
Denis Vlasenko
0de37e10ed ash: use fdprintf, not dprintf.
*: trailing whitespace removed
2007-10-17 11:08:53 +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
82d38dab91 get rid of global "struct bb_applet *current_applet" 2007-10-10 14:38:47 +00:00
Denis Vlasenko
41770226bb ash: revert "cat | jobs" fix, it causes more problems than good 2007-10-07 18:02:52 +00:00
Denis Vlasenko
96e1b38586 introduce and use close_on_exec_on(fd). -50 bytes. 2007-09-30 23:50:48 +00:00
Denis Vlasenko
6081868ee3 fix "if (p) free(p)" constructs 2007-09-28 22:07:23 +00:00
Denis Vlasenko
46a530626d ash: fix prompt expansion (Natanael Copa <natanael.copa@gmail.com>) 2007-09-24 18:30:02 +00:00
Denis Vlasenko
7b70d78de8 ash: remove erroneously applied patch 2007-09-21 22:48:02 +00:00
Denis Vlasenko
f431017535 httpd: optional support for partial downloads 2007-09-21 22:35:18 +00:00
Denis Vlasenko
bcceb0c5a4 ash: s/int/smallint/. -60 bytes. 2007-09-21 18:06:20 +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
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
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
dee82b6b78 ash: comment non-obvious code part 2007-07-29 14:05:27 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
d4293c77f1 ash: fix SEGV in forkchild (jp can be NULL). here documents were affected. 2007-07-18 21:35:43 +00:00
Denis Vlasenko
bdc406d15d ash: make "jobs | cat" work like in bash (was giving empty output) 2007-07-15 01:13:25 +00:00
Denis Vlasenko
fcfaf2e18a ash: small size optimization
function                                             old     new   delta
makejob                                              263     270      +7
setjobctl                                            328     332      +4
jobscmd                                               96      94      -2
stoppedjobs                                           53      50      -3
jobctl                                                 4       1      -3
job_warning                                            4       1      -3
forkshell                                            644     641      -3
cmdloop                                              422     409     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/6 up/down: 11/-27)            Total: -16 bytes
   text    data     bss     dec     hex filename
 675392    2740   13968  692100   a8f84 busybox_old
 675380    2740   13968  692088   a8f78 busybox_unstripped
2007-07-14 18:45:37 +00:00
Denis Vlasenko
8fdc4b7b06 ash: recognize -l as --login equivalent; do not recognize +-login 2007-07-14 11:33:10 +00:00
Denis Vlasenko
40ba9984fd ash: fix for buglet in DEBUG code (Nguyen Thai Ngoc Duy <pclouds@gmail.com>) 2007-07-14 00:48:29 +00:00
Denis Vlasenko
1fc6238ffa devfsd: fix formatting (Tito <farmatito@tiscali.it>)
ash: fix SEGV if type has zero parameters
2007-06-25 22:55:34 +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
b304eadca8 test: shrink a bit
function                                             old     new   delta
test_main                                              5     434    +429
bb_test                                              473       -    -473
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 429/-473)          Total: -44 bytes
   text    data     bss     dec     hex filename
 735073    3028   14408  752509   b7b7d busybox_old
 735029    3028   14408  752465   b7b51 busybox_unstripped
2007-06-21 13:35:52 +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
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
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
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
46846e25a4 ash: implement type -p, costs less than 10 bytes
(patch by Mats Erik Andersson <mats.andersson64@comhem.se>)
2007-05-20 13:08:31 +00:00
Denis Vlasenko
5b34083004 several *.c files:
move 'extern environ' up to the location of #includes
2007-05-17 23:02:14 +00:00
Denis Vlasenko
f20de5bb42 ash,kill: use common code for kill applet/builtin
# make bloatcheck
function                                             old     new   delta
evaltreenr                                           644     654     +10
evaltree                                             644     654     +10
parse_conf                                          1440    1444      +4
dpkg_deb_main                                        426     429      +3
ed_main                                             3319    3321      +2
passwd_main                                         2093    2091      -2
kill_main                                            830     826      -4
singlemount                                         4609    4601      -8
find_command                                         962     954      -8
get_lcm                                              123     105     -18
.rodata                                           132243  132147     -96
killcmd                                              449     120    -329
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/7 up/down: 29/-465)          Total: -436 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 723901    2940   27504  754345   b82a9 busybox_old
 723457    2940   27504  753901   b80ed busybox_unstripped
2007-04-29 23:42:54 +00:00
Denis Vlasenko
08c8c1d3b3 ash: fix infinite loop on exit if tty is not there anymore 2007-04-28 22:39:02 +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
d7c8196c1b ash: fix kill -l (by Mats Erik Andersson <mats.andersson64@comhem.se>) 2007-04-11 20:43:31 +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
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
c44ab01b75 Improve STANDALONE_SHELL. "safe" applets are renamed NOEXEC applets
and now this fact is recorded in applets.h, not ash.c.

Several fixes to "--help + STANDALONE_SHELL" scenarios.

function                                             old     new   delta
run_current_applet_and_exit                            -     355    +355
arith                                               2064    2073      +9
refresh                                             1148    1156      +8
getopt32                                            1068    1073      +5
telnet_main                                         1510    1514      +4
md5_sha1_sum_main                                    565     566      +1
xstrtoul_range_sfx                                   255     251      -4
packed_usage                                       22523   22514      -9
tryexec                                              255     203     -52
static.safe_applets                                  152       -    -152
.rodata                                           131320  131128    -192
run_applet_by_name                                   869     506    -363
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 5/5 up/down: 382/-772)         Total: -390 bytes

./busybox ash -c 'i=20000; while test $i != 0; do touch z; i=$((i-1)); done'
runs more than twice as fast with STANDALONE_SHELL versus without.
2007-04-09 03:11:58 +00:00
Denis Vlasenko
240a1cfbbe add some missed statics on constant objects.
fix few #ifndef ENABLE_xxx

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 677152    2920   18208  698280   aa7a8 busybox_old
 676420    2920   18208  697548   aa4cc busybox_unstripped
2007-04-08 16:07:02 +00:00
Denis Vlasenko
7c139b4778 ash: fix signal handling 2007-03-21 20:17:27 +00:00
Denis Vlasenko
93ebd4f58d ash: popstackmark is reported trying to pop until NULL
is seen (which isn't possible), prevent this.
2007-03-13 20:55:36 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
3af3e5b4b0 ash: cosmetic improvements in error messages 2007-03-05 00:24:52 +00:00
Denis Vlasenko
29e31ddd81 ash: do not use "safe applets" in non-standalone shell 2007-03-03 23:12:17 +00:00
Denis Vlasenko
4222ae440a ash: replace xstrdup (shell shall not die)
grep: fix mis-indented block
2007-02-25 02:37:49 +00:00
Denis Vlasenko
5276402f2c ash: fix compile problems 2007-02-24 13:42:56 +00:00
Denis Vlasenko
f98dc4db7a ash: cleanup part 2.8 2007-02-23 21:11:02 +00:00
Denis Vlasenko
0dec6de38b ash: cleanup part 2.7 2007-02-23 21:10:47 +00:00
Denis Vlasenko
cc5715184b ash: cleanup part 2.6 2007-02-23 21:10:35 +00:00
Denis Vlasenko
2de3d9fbee ash: cleanup part 2.5 2007-02-23 21:10:23 +00:00
Denis Vlasenko
a89150733a ash: cleanup part 2.4 2007-02-23 21:10:06 +00:00
Denis Vlasenko
99eb8500c9 ash: cleanup part 2.3 2007-02-23 21:09:49 +00:00
Denis Vlasenko
fc06f2968b ash: cleanup part 2.2 2007-02-23 21:09:35 +00:00
Denis Vlasenko
5651bfc204 ash: starting second round of cleanups. #1 2007-02-23 21:08:58 +00:00
Denis Vlasenko
bc54cffc83 ash: cleanup part 9 2007-02-23 01:05:52 +00:00
Denis Vlasenko
4d2183bee1 ash: cleanup part 8 2007-02-23 01:05:38 +00:00
Denis Vlasenko
4fe15f3d9e ash: cleanup part 7 2007-02-23 01:05:26 +00:00
Denis Vlasenko
a6704933dd ash: cleanup part 6 2007-02-23 01:05:15 +00:00
Denis Vlasenko
5c67e3ed90 ash: cleanup part 5 2007-02-23 01:05:03 +00:00
Denis Vlasenko
fe1f00a7a7 ash: cleanup part 4 2007-02-23 01:04:50 +00:00
Denis Vlasenko
9650f36210 ash: cleanup part 3 2007-02-23 01:04:37 +00:00
Denis Vlasenko
aa74445514 ash: cleanup part 2 2007-02-23 01:04:22 +00:00
Denis Vlasenko
0c032a49b9 ash: cleanup part 1 2007-02-23 01:03:40 +00:00
Denis Vlasenko
a624c11d5e ash: move ash_main() and helpers to end of ash.c, more fuctions renamed,
superfluous casts from memory allocators removed
2007-02-19 22:45:43 +00:00
Denis Vlasenko
2da584fc4e ash: more renaming and style fixes 2007-02-19 22:44:05 +00:00
Denis Vlasenko
b012b10dbd ash: rearrange code to reduce forward references, rename some functions 2007-02-19 22:43:01 +00:00
Denis Vlasenko
e5570da2cf ash: tiny style fixes 2007-02-19 22:41:55 +00:00
Denis Vlasenko
5cedb75aa7 ash: de-obfuscate code, add 'static' keyword, etc. 2007-02-18 19:56:41 +00:00
Denis Vlasenko
131ae177a7 ash: convert #ifdef CONFIG_ to #if ENABLE_ 2007-02-18 13:00:19 +00:00
Denis Vlasenko
a0f82e928a ash: fix indentation and style. no code changes 2007-02-18 12:35:30 +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
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
8e1c71529c Convert cmdedit into more generic line input facility
(make history and completion optional at runtime).
Use it for fdisk, as an example.
Some unrelated fixes in fdisk are also here.
2007-01-22 07:21:38 +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
Denis Vlasenko
7f0d7ae4f5 fix subtle bug inherited from dash 2007-01-18 01:12:57 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko
62a6983a81 execute "safe applets" exev if not standalone shell
(patch by "Eric Spakman" <E.Spakman@inter.nl.net>)
2007-01-10 00:24:50 +00:00
Denis Vlasenko
8f27c34c28 ash: is_safe_applet mustn't affect disabled applets 2006-12-26 21:31:11 +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
0ee3999d13 random tiny size savings 2006-12-24 15:23:28 +00:00
Denis Vlasenko
f4dff77355 less: implement waiting for input using select(). Rather tricky business.
But we do not read entire input anymore up-front.
2006-12-24 07:14:17 +00:00
Denis Vlasenko
bf66fbc8e2 introduce LONE_CHAR (optimized strcmp with one-char string) 2006-12-21 13:23:14 +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
83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +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
097c324f59 fix remaining survivors of the return(a) cleanup 2006-11-27 16:59:15 +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
fcdb00f735 httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net! 2006-11-21 00:09:37 +00:00
Denis Vlasenko
a7189f01a4 add -Wundef, fix uncovered bugs 2006-11-17 20:29:00 +00:00
Denis Vlasenko
5f03158f66 ash: fix segfault in ash.
patch by walter harms <wharms@bfs.de>
2006-10-16 01:33:16 +00:00
Denis Vlasenko
cba9ef5523 fixes from Vladimir Dronnikov <dronnikov@gmail.ru> 2006-10-10 21:00:47 +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
e175ff252f several fixes from openWRT project 2006-09-26 17:41:00 +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
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
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
f296f0b77d Bug fix from Vladimir Oleynic via Paul Fox for:
echo "+bond0" > /sys/class/net/bonding_masters
while true; do
  echo hello
done
2006-07-06 01:09:21 +00:00
"Robert P. J. Day"
177c9f3128 Get rid of all "#if 0" content. 2006-07-01 14:30:28 +00:00
"Robert P. J. Day"
68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
Bernhard Reutner-Fischer
f087798e8b - convert old-style parameter declarations (K&R) to modern style. 2006-06-25 22:08:53 +00:00
Bernhard Reutner-Fischer
35492137f8 - add note about strict ordering 2006-06-21 18:19:53 +00:00
Mike Frysinger
c2ad4f5d27 Jean Wolter writes: ash uses bsearch to search in the list of built-in commands, therefore the list of built-in commands has to be ordered. Revision 15077 introduced the source built-in and destroyed this order. And now ash doesn't find the shift command anymore. 2006-06-21 18:04:49 +00:00
Rob Landley
a34b48abe5 Upgrade the standalone shell code to use CONFIG_BUSYBOX_EXEC_PATH. 2006-06-14 01:27:01 +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
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +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
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Bernhard Reutner-Fischer
0a8812bdc5 - replace _PATH_DEVNULL with bb_dev_null 2006-05-19 13:12:21 +00:00
Rob Landley
47b1838957 Patch from Lucas C. Villa Real adding "source" as a synonym for the "." command. 2006-05-12 20:44:16 +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
Eric Andersen
a68ea1cb93 fix up yet more annoying signed/unsigned and mixed type errors 2006-01-30 22:48:39 +00:00
"Vladimir N. Oleynik"
84005af7ef C99 say: "char" declaration may be signed or unsigned default 2006-01-25 17:53:04 +00:00
"Vladimir N. Oleynik"
fdb871c498 Add more bash-like dot-dirs cmdedit feature
Close bug 648.
Restore my whitespace
2006-01-25 11:53:47 +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
"Vladimir N. Oleynik"
cfc8f59649 restore 8-bit syntax works, last debian patch is broken. Noticed by Vladimir Dronnikov 2006-01-19 11:23:34 +00:00
"Vladimir N. Oleynik"
fb29b46201 sync with dash_0.5.3-1 2006-01-15 14:21:01 +00:00
"Vladimir N. Oleynik"
ddc280ec43 sync license from mainstream 2005-12-15 12:01:49 +00:00
"Vladimir N. Oleynik"
e6d88ea2a1 remove sigsetmask, noticed by Bernhard 2005-12-13 13:24:23 +00:00
"Vladimir N. Oleynik"
6f347ef9dc common BUFSIZ BSS buffer, small reduce code, data and bss 2005-10-15 10:23:55 +00:00
"Vladimir N. Oleynik"
11d7c52912 correct set prompt if CONFIG_ASH_EXPAND_PRMT enabled, small automatic space->tabs convert by my personal editor 2005-09-26 13:24:45 +00:00
Paul Fox
02eb934b0f committing:
Summary      0000242: ash: read -t broken
this also implements -n and -s options to read.  (they're configured
together because most of their code is in common, and separating them
seemed silly.
2005-09-07 16:56:02 +00:00
"Vladimir N. Oleynik"
bef14d7a87 1) sync with dash_0.5.2-7
2) but expand PS# as config option
3) correct kill error message again
4) remove show "line number" for interactive run (patch pending for dash)
2005-09-05 13:25:11 +00:00
Rob Landley
23246f39ed Patch from Stephane Billiart to improve ash error message. 2005-08-14 19:16:51 +00:00
Paul Fox
0b62158475 implemented a builtin echo command in ash. moved the guts of the
echo applet into libbb, and now call bb_echo() from both echo.c
and ash.c
2005-08-09 19:38:05 +00:00
Paul Fox
3f11b1bf63 commiting:
0000025: vi-editing mode for ash
2005-08-04 19:04:46 +00:00
Paul Fox
8de331def0 revert 10881, and refix by changing "if (vallen)" to "if (val)". this
is per the upstream fix for dash, in dash_0.5.2-6.diff.  thanks vodz, for
catching this.
2005-07-21 12:03:05 +00:00
Paul Fox
6f267f022f applying fix for:
0000261: Unsafe empty env var export in ash
2005-07-20 19:18:45 +00:00
Paul Fox
c3850c83d9 applying fix from:
0000152: ash: quoting rules for local variables different to globals
2005-07-20 18:23:39 +00:00
Rob Landley
0fcd9430ce This one's from me. Fix ash "standalone shell".
If we exec /proc/self/exe and only fall back to /bin/busybox if /proc isn't
there, then we have a reasonable chance of having the standalone shell work
even if busybox isn't installed in /bin on the system in question.

Still won't work in a chroot environment, but it's an improvement.
2005-05-07 08:27:34 +00:00
Ned Ludd
d1e3cbdb5a - no need to check if JOBS is defined. Config.in ensures it. 2005-02-10 00:44:31 +00:00