aboutsummaryrefslogtreecommitdiff
path: root/miscutils/rx.c
Commit message (Collapse)AuthorAgeFilesLines
* build system: drop PLATFORM_LINUXGravatar Ron Yorston2020-08-131-1/+0
| | | | | | | | | | | | | | | PLATFORM_LINUX is a hidden configuration option which is disabled by default and enabled at over a hundred locations for features that are deemed to be Linux specific. The only effect of PLATFORM_LINUX is to control compilation of libbb/match_fstype.c. This file is only needed by mount and umount. Remove all references to PLATFORM_LINUX and compile match_fstype.c if mount or umount is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: reduce the overhead of single parameter bb_error_msg() callsGravatar James Byrne2019-07-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: deindent all help textsGravatar Denys Vlasenko2017-07-211-1/+1
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update menuconfig items with approximate applet sizesGravatar Denys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Replace int -> uint to avoid signed integer overflowGravatar Rostislav Skudnov2017-02-041-1/+1
| | | | | | | | | | An example of such an error (should be compiled with DEBUG_SANITIZE): runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: consolidate the code to set termios unbuffered modeGravatar Denys Vlasenko2017-01-111-0/+1
| | | | | | | | | | | | | | | | function old new delta set_termios_to_raw - 116 +116 count_lines 72 74 +2 powertop_main 1458 1430 -28 top_main 943 914 -29 more_main 759 714 -45 fsck_minix_main 2969 2921 -48 conspy_main 1197 1135 -62 rawmode 99 36 -63 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 118/-275) Total: -157 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Code style fixes, no code changesGravatar Denys Vlasenko2016-11-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Convert all miscutils/* applets to "new style" applet definitionsGravatar Denys Vlasenko2016-11-221-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Split miscutils/Config.src items into miscutils/*.c filesGravatar Denys Vlasenko2016-11-221-0/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesGravatar Denys Vlasenko2013-01-151-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rx: fix file corruption on block checksum failureGravatar Daniel Fandrich2011-11-231-0/+1
| | | | | | | | Rather than dropping the bad block, rx was appending it to the file. Signed-off-by: Daniel Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rx: code shrinkGravatar Denys Vlasenko2011-11-031-13/+7
| | | | | | | function old new delta rx_main 961 947 -14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rx: Fix file corruption with duplicate blocksGravatar Dan Fandrich2011-11-031-0/+1
| | | | | | | Rather than dropping the dupe, rx was appending it to the file. Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hGravatar Pere Orga2011-04-111-0/+8
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularGravatar Denys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove a few more cases of argc usage. -89 bytes.Gravatar Denys Vlasenko2009-11-281-5/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rx: strip padding from last block. closes bug 501.Gravatar Denys Vlasenko2009-08-021-43/+59
| | | | | | | function old new delta rx_main 876 974 +98 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: rename ATTRIBUTE_XXX to just XXX.Gravatar Denis Vlasenko2008-07-051-1/+1
|
* libbb: introduse and use signal_[no_]SA_RESTART_empty_mask and sigaction_setGravatar Denis Vlasenko2008-03-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | signal_SA_RESTART_empty_mask - 65 +65 signal_no_SA_RESTART_empty_mask - 54 +54 dd_main 1325 1369 +44 sigaction_set - 19 +19 dname_enc 373 377 +4 UNSPEC_print 64 66 +2 setsignal 296 294 -2 bb_signals_recursive 95 92 -3 bb_askpass 367 361 -6 inetd_main 1810 1797 -13 rx_main 912 883 -29 sigdelset 32 - -32 __sigdelset 32 - -32 __GI_sigdelset 32 - -32 sighup_handler 84 37 -47 arping_main 1844 1797 -47 fsck_main 1869 1807 -62 run_list 1917 1844 -73 vlock_main 492 409 -83 progressmeter 883 798 -85 handle_incoming_and_exit 2737 2651 -86 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 3/12 up/down: 188/-632) Total: -444 bytes
* nc: remove a bit of bloatGravatar Denis Vlasenko2008-03-121-133/+99
| | | | | | | | | | | | | | | | | | | | | | | | | inetd: more NOMMU fixes rx: shrink devfsd: minor shrink vlock: shrink tcpudp: narrow down window where we have no wildcard socket parse_one_line 1015 1102 +87 init_ring - 53 +53 xzalloc_lsa - 48 +48 read_byte 51 50 -1 rearm_alarm 28 25 -3 nc_main 1028 1000 -28 initring 53 - -53 vlock_main 583 496 -87 reread_config_file 1089 991 -98 rx_main 1046 912 -134 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/6 up/down: 188/-404) Total: -216 bytes text data bss dec hex filename 800120 661 7428 808209 c5511 busybox_old 799796 661 7428 807885 c53cd busybox_unstripped
* less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)Gravatar Denis Vlasenko2008-02-241-1/+1
| | | | | *: minor shrink
* add -fvisibility=hidden to CC flags, mark XXX_main functionsGravatar Denis Vlasenko2007-10-111-1/+1
| | | | | EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
* usage.c: remove reference to busybox.hGravatar Denis Vlasenko2007-05-261-1/+1
| | | | | *: s/include "busybox.h"/include "libbb.h"
* style fixes, no code changesGravatar Denis Vlasenko2007-04-161-1/+2
|
* suppress warnings about easch <applet>_main() havingGravatar Denis Vlasenko2007-02-031-0/+1
| | | | no preceding prototype
* - sed -i -e "/\$Id:/d;"Gravatar Bernhard Reutner-Fischer2007-01-221-1/+0
|
* small fixes:Gravatar Denis Vlasenko2006-11-261-1/+1
| | | | | | fix xstrdup to not grossly overallocate memory use xopen instean of xopen3 in several places etc.
* remove bb_printf and the likeGravatar Denis Vlasenko2006-10-261-1/+1
|
* build system overhaulGravatar Denis Vlasenko2006-10-051-3/+2
|
* - convert a few xopen3(,,0) into xopen(,). Also peruse the fact that xopen ↵Gravatar Bernhard Reutner-Fischer2006-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | defaults to 0777 on it's own, so we don't need to xopen3(,,0777). Saves a few bytes: $ size busybox.old busybox text data bss dec hex filename 839676 8780 243592 1092048 10a9d0 busybox.old 839660 8780 243592 1092032 10a9c0 busybox $ make CC=gcc-4.2-HEAD bloatcheck function old new delta static.vconfig_main 281 279 -2 static.rx_main 1076 1074 -2 static.mt_main 294 292 -2 static.gzip_main 753 751 -2 static.mkfs_minix_main 4034 4030 -4 static.unzip_main 1771 1766 -5 static.crontab_main 1513 1507 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-23) Total: -23 bytes
* removed a lot of trailing \n in bb_msg() calls. It is addedGravatar Denis Vlasenko2006-09-061-2/+2
| | | | | automatically by function itself.
* Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateGravatar Rob Landley2006-08-031-14/+2
| | | | | | | | | | 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.)
* Cleaup read() and write() variants, plus a couple of new functions likeGravatar Rob Landley2006-07-161-1/+1
| | | | xlseek and fdlength() for the new mkswap.
* Aurelien Jacobs pointed out inline functions that could be removed. Doing soGravatar Rob Landley2006-06-211-29/+13
| | | | shrank the code a bit.
* - move #include busybox.h to the very top so we pull in the configGravatar Bernhard Reutner-Fischer2006-06-031-1/+1
| | | | and eventual platform specific includes in early.
* - use the defines CURRENT_TTY and VC_1; also shrink xargs a tiny bit:Gravatar Bernhard Reutner-Fischer2006-05-271-1/+1
| | | | | | | | | | | | | | | | add/remove: 0/0 grow/shrink: 2/6 up/down: 5/-37 (-32) function old new delta static.add_interface 271 274 +3 static.glob3 36 38 +2 static.renice_main 409 408 -1 static.readcmd 1083 1081 -2 static.changepath 176 174 -2 static.parse_opts 56 51 -5 static.rx_main 1095 1088 -7 static.xargs_main 759 739 -20 ---------------------------------------------------------------- Result :-) -32
* - remove emacs layout block as suggested by Robert P.J. DayGravatar Bernhard Reutner-Fischer2006-05-191-8/+0
| | | | - use shorter boilerplate while at it
* - patch from Denis Vlasenko to add and use bb_xopen3()Gravatar Bernhard Reutner-Fischer2006-04-131-7/+3
|
* - add some ATTRIBUTE_UNUSED.Gravatar Bernhard Reutner-Fischer2006-01-301-15/+2
| | | | - use shorter boilerplate while at it.
* Remove trailing whitespace. Update copyright to include 2004.Gravatar Eric Andersen2004-03-151-7/+7
|
* New applet, rx, by Christopher HooverGravatar Glenn L McGrath2003-12-201-0/+344