Commit Graph

80 Commits

Author SHA1 Message Date
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +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
f7be20e70c nameif: extended matching (Nico Erfurth <masta@perlgolf.de>)
*: whitespace fixes

function                                             old     new   delta
prepend_new_eth_table                                  -     304    +304
nameif_main                                          620     684     +64
cc_macaddr                                            51       -     -51
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 368/-51)           Total: 317 bytes
2007-12-24 14:09:19 +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
4daad9004d introduce bb_putchar(). saves ~1800 on uclibc (less on glibc). 2007-09-27 10:20:47 +00:00
Denis Vlasenko
856be770a6 assorted fixes for breakage found by randomconfig 2007-08-17 08:29:48 +00:00
Denis Vlasenko
033e592cbc more: by Tristan Schmelcher <tpkschme@engmail.uwaterloo.ca>:
- Fixed a number of deficiencies in the line wrapping.
- Fixed a bug where the page could scroll multiple times per keypress.
- Re-read terminal dimensions after user input, in case they
  resized the terminal while we were waiting.
- Added an 'R' key to print the rest of the file without prompting.
- Crudely support tabs in the line-wrapping code by converting
  them to 8 spaces.
2007-08-15 20:42:52 +00:00
Denis Vlasenko
c2f011aa03 more: stop using bss
# make && make bloatcheck
function                                             old     new   delta
gotsig                                                86     107     +21
more_main                                            777     781      +4
cin_fileno                                             4       -      -4
set_tty_to_initial_mode                               25       -     -25
new_settings                                         120      60     -60
initial_settings                                     120      60     -60
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 2/2 up/down: 25/-149)          Total: -124 bytes
2007-05-31 21:31:56 +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
4eb8b936cb more: do not mess with "/dev/console" (!);
fill whole 1st screen (was "screen sans one line");
    fall back to cat if redirected or no ctty
less: fall back to cat if no ctty (was exiting)
resize: cosmetics
2007-03-10 16:32:14 +00:00
Denis Vlasenko
ec27feb045 init: code readability enhancements; very small code changes 2007-02-17 15:52:02 +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
b15b7f7a4a more: fix for case when _FILE_OFFSET_BITS is not #defined.
samll size improvement.
2006-12-10 01:57:29 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +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
c44bc986b7 Fix some warnings in allbareconfig. 2006-05-28 01:19:06 +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
Eric Andersen
70060d25d2 s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g
2004-03-27 10:02:48 +00:00
Eric Andersen
edd580a088 Vladimir N. Oleynik (vodz) writes:
Ok. Last patch reduce 73 bytes for compensate (and over) your changes ;-)

Comments:
Added cin_fileno variable, auto setted to 0 from BSS and have "eq" stdin
descriptor if isatty(stout)==0, removed global variable FILE* cin.
Removed default setting to terminal_width/terminal_height, this used
only from main() and setted after call get_terminal_width_height()
always correct.
Variable please_display_more_prompt changed to bits logic, have size
reducing.
--w
vodz
2004-03-27 09:49:57 +00:00
Eric Andersen
97310d0253 Brian Pomerantz writes:
I've noticed a bug in the "autowidth" feature more, and is probably in
others.  The call to the function get_terminal_width_height() passes
in a file descriptor but that file descriptor is never used, instead
the ioctl() is called with 0.  In more_main() the call to
get_terminal_width_height() passes 0 as the file descriptor instead of
fileno(cin).  This isn't a problem when you more a file (e.g. "more
/etc/passwd") but when you pipe a file to it (e.g. "cat /etc/passwd |
more") the size of the terminal cannot be determined because file
descriptor 0 is not a terminal.  The fix is simple, I've attached a
patch for more.c and get_terminal_width_height.c.


BAPper
2004-03-23 23:15:36 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Eric Andersen
5089534be0 match changes made to cmdedit 2003-12-23 20:47:22 +00:00
Eric Andersen
8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Eric Andersen
cb81e6484d Update a bunch of docs. Run a script to update my email addr. 2003-07-14 21:21:08 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Glenn L McGrath
b4a1baa312 Correct some init issues, update email address, last_patch78 by Vladimir
N. Oleynik
2003-01-13 22:09:50 +00:00
Eric Andersen
1d1d2f9b18 Update some missing copyright notices 2002-04-13 08:31:59 +00:00
Eric Andersen
0ee0a8d539 Fix running more on files in the (broken) procfs that claim 0 length
when that isn't actually true.
 -Erik
2001-12-06 07:24:29 +00:00
Eric Andersen
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Matt Kraai
439e3df653 Add support for devfs device names. 2001-07-23 14:52:08 +00:00
Glenn L McGrath
78b0e379d7 Vladimir's last_patch_15 2001-06-26 02:06:08 +00:00
Eric Andersen
2439a59828 Remove/replace the "div" call. 2001-05-16 18:53:34 +00:00
Eric Andersen
04095e58fb Move messages.c to libbb. Make each string in messages.c be its own .o file.
This way, we can new get rid of all that tedious #define rubbish we used to
need to enable specific messages.  This way is enormously simpler, and as a
bonus also ends up saving us 96 bytes.
 -Erik
2001-04-25 05:39:18 +00:00
Matt Kraai
d6cde0bcf4 Fix return code and don't output spurious newlines. 2001-04-12 20:51:01 +00:00
Eric Andersen
aa21e0f913 An optimization from Vladimir 2001-04-06 16:02:22 +00:00
Eric Andersen
250a221768 more FILE_OFFSET_BITS == 64 adjustments. 2001-04-05 23:26:44 +00:00
Eric Andersen
21af752b04 Patch to use xfopen from Jeff Garzik 2001-03-23 17:09:15 +00:00
Eric Andersen
5723934f7c Yet another fix. I think I got it this time.
-Erik
2001-02-23 01:39:26 +00:00
Eric Andersen
ffc40bf3de Account for remainder, and reset page_height for each and every page. 2001-02-22 21:49:32 +00:00
Eric Andersen
be30a6b8b0 Adjust the terminal height for any overlap, so that no lines
get lost off the top
 -Erik
2001-02-22 00:22:46 +00:00
Eric Andersen
cbe31dace5 It turns out that DODMALLOC was broken when I reorganized busybox.h
header file usage before the 0.49 release.  To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
 -Erik
2001-02-20 06:14:08 +00:00
Eric Andersen
c3fc3c5e7a It seems I stupidly checked in a silly test I was making.
-Erik
2001-02-02 15:15:36 +00:00
Eric Andersen
af4ac77d9d Apply a patch from Larry Doolittle to add "-all" and "-none" switches
to multibuild.pl.  I did a little formatting adjustments to make it
_very_ obvious when things stop working.  I also removed the USE_PROCFS
config option -- just do the right thing when USE_DEVPS_PATCH is enabled.
 -Erik
2001-02-01 22:43:49 +00:00
Eric Andersen
ed3ef50c23 Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles.  I left only what was needed and then fixed up
all the apps to include their own header files.  I also fixed naming for pwd.h
and grp.h functions.  Tested to compile and run with libc5, glibc, and uClibc.
 -Erik
2001-01-27 08:24:39 +00:00
Eric Andersen
5c9c8b4b26 Make cin be static 2001-01-26 06:50:46 +00:00
Matt Kraai
12f417edbd Eliminate calls of the form "fprintf(stdout,". Thanks for the idea to
Vladimir N. Oleynik.
2001-01-18 02:57:08 +00:00
Matt Kraai
e6e818309e Improvements from Vladimir N. Oleynik. 2000-12-30 07:46:23 +00:00
Eric Andersen
63a862272c Cleanup of duplicated symbols -- found by compiling with
LDFLAGS += -Wl,-warn-common
2000-11-07 06:52:13 +00:00
Matt Kraai
bbaef66b3f Consolidate handling of some fopen failures. 2000-09-27 02:43:35 +00:00
Eric Andersen
3570a34de4 Renamed "internal.h" to the more sensible "busybox.h".
-Erik
2000-09-25 21:45:58 +00:00