Commit Graph

13668 Commits

Author SHA1 Message Date
Stephen Heumann
051b79efc1 Move all the source files to 15-character ProDOS-compatible file names.
Dmake gets confused if you use over-15-character file names, so they needed to be shortened to get it to work. While I was at it, I also switched _ to . in the filenames so they're fully ProDOS compatible.

The shell/hush_test directory (not needed to build the code) still uses ProDOS-incompatible file names.
2014-11-02 22:11:07 -06:00
Stephen Heumann
d4b2c3ce8b Various changes for GNO and ORCA/C compatibility. 2014-11-02 18:30:31 -06:00
Stephen Heumann
97e65e3480 Remove C99isms from coreutils/test.c.
It now compiles successfully with ORCA/C.
2014-11-02 00:39:21 -05:00
Stephen Heumann
a3d8a81bb0 Add makefile (which can be used on GNO or a modern system), and build scripts based on in. 2014-11-01 22:59:10 -05:00
Stephen Heumann
875b1bbd0e More GNO and ORCA/C compatibility fixes.
Everything in the shell directory now compiles.
2014-11-01 18:25:21 -05:00
Stephen Heumann
2464399542 Convert additional vfork calls to xvfork_and_run. 2014-11-01 16:59:17 -05:00
Stephen Heumann
d7a6168aa1 ORCA/C compat fixes. Variables must be at beginning of block. 2014-11-01 16:07:30 -05:00
Stephen Heumann
3577d48e74 Change the ARRAY_SIZE macro to work around an ORCA/C limitation. 2014-11-01 15:47:17 -05:00
Stephen Heumann
2b0d727f39 Include glob implementation from dietlibc.
GNO doesn't actually implement glob, although it has a header for it. The GNO header is from an old BSD version and is missing some constants we need, so don't use it.
2014-11-01 14:27:52 -05:00
Stephen Heumann
f6c7fdc027 GNO/ORCA compatiblity: remove final comma in enums, and appropriately define stuff that GNO doesn't have in platform.h. 2014-11-01 14:22:47 -05:00
Stephen Heumann
3709307794 Get rid of varargs macros in hush.c. 2014-11-01 11:25:19 -05:00
Stephen Heumann
8f6869ae25 Miscellaneous changes for ORCA/C and GNO compatibility, mainly removing C99isms.
At this point, ORCA/C can process the main header files, and some smaller source files compile without errors.
2014-11-01 09:46:02 -05:00
Michel Stam
fdd957bdc9 zcip: allow our own class B range to be used for ZeroConf
169.254 may already be used by a local network. This patch allows
specifying your own IP range.

Our particular use case is a mesh network, in which the nodes partaking
were using an IP range specifically assigned for the meshing purpose.
As the LAN side of the mesh node could use 169.254, this default range
was not an option.

function                                             old     new   delta
zcip_main                                           1342    1426     +84
pick_nip                                               -      40     +40
packed_usage                                       29974   29969      -5
pick                                                  34       -     -34
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/1 up/down: 124/-39)            Total: 85 bytes

Signed-off-by: Michel Stam <m.stam@fugro.nl>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-30 13:43:09 +01:00
Michel Stam
9f41271f3c udhcpd: add option for tweaking arpping
Some clients have a very short timeout for sending the DHCP
DISCOVER, shorter than the arpping timeout of 2000 milliseconds
that udhcpd uses by default.

This patch allows tweaking the timeout, or disabling of arpping
altogether, at the risk of handing out addresses which are
already in use.

function                                             old     new   delta
udhcpd_main                                         1460    1501     +41
udhcpc_main                                         2814    2851     +37
packed_usage                                       29957   29974     +17
arpping                                              477     493     +16
find_free_or_expired_nip                             161     174     +13
send_offer                                           285     292      +7
nobody_responds_to_arp                                85      89      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/0 up/down: 135/0)             Total: 135 bytes

Signed-off-by: Michel Stam <m.stam@fugro.nl>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-30 11:59:04 +01:00
Stephen Heumann
b7676499be More removal of stuff that used long longs 2014-10-27 19:45:38 -05:00
Stephen Heumann
6c2c9d8865 Get rid of long longs in the the hush code (but not yet in the libraries) 2014-10-27 14:09:00 -05:00
Stephen Heumann
16c89af688 Change vfork calls to use vfork_and_run operation with GNO-compatible semantics 2014-10-27 13:10:11 -05:00
Stephen Heumann
e61b4040ec Make char unsigned, as busybox is designed for (and as ORCA/C does) 2014-10-27 00:48:59 -05:00
Stephen Heumann
a00ca4770f Eliminate or disable all the warnings given by clang -Wall 2014-10-26 23:30:51 -05:00
Stephen Heumann
472db3bd56 Delete the stuff that's irrelevant to hush. Also, include (a simplified version of) the autoconf-generated headers and a simple build script, so it can easily be build in the hush-only configuration. 2014-10-26 22:39:01 -05:00
Stephen Heumann
ef1a853400 Minimal changes to enable hush-only builds on OS X 2014-10-26 21:14:47 -05:00
Miroslav Lichvar
760d035699 ntpd: calculate offset to jitter ratio before updating jitter
The offset to jitter ratio is now calculated before updating
jitter to make the test more sensitive.

function                                             old     new   delta
ntp_init                                             460     474     +14
update_local_clock                                   752     764     +12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 26/0)               Total: 26 bytes

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-05 03:11:53 +02:00
Denys Vlasenko
cd73871178 sed: fix "sed CMD -i nonexistent_file". Closes 7484
function                                             old     new   delta
sed_main                                             643     676     +33

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-05 02:44:34 +02:00
Miroslav Lichvar
b434ce7069 ntpd: don't stay at short polling interval
To avoid polling servers frequently slowly increase the interval up
to BIGPOLL when
- no replies are received from a peer
- no source can be selected
- peer claims to be unsynchronized (e.g. we are polling it too
  frequently)

When recv() returns with an error, drop code to try to continue
on network errors: I'm not convinced those cases happen in real life.

function                                             old     new   delta
recv_and_process_peer_pkt                            919     838     -81

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-02 17:24:34 +02:00
Denys Vlasenko
cf76b5ce12 getty: set tty attrs so that control chars are shown as ^c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-02 13:45:21 +02:00
Denys Vlasenko
d3fe960271 ntpd: be less eager to use shorter poll intervals
* on step, poll interval drops to 8.5 mins instead of 32 seconds
* on total loss of all replies (no replies from any peer
  for last 8 requests), also drop poll interval to 8.5 mins
  instead of 32 seconds
* on send abd recv errors, RETRY_INTERVAL is now 32 seconds,
  not 5 seconds
* on timing out listening to reply, instead of unconditional
  shortening poll interval by x4, clamp it to NOREPLY_INTERVAL
  (512 seconds)
* if a largish offset is seen, clamp nexp poll interval
  to 128 seconds, not 64 seconds

function                                             old     new   delta
clamp_pollexp_and_set_MAXSTRAT                         -      37     +37
recv_and_process_peer_pkt                            861     869      +8
poll_interval                                         52      48      -4
update_local_clock                                   762     752     -10
ntpd_main                                           1063    1050     -13
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 45/-27)             Total: 18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-27 22:56:09 +02:00
Denys Vlasenko
186b98a86f ubiupdatevol: fix -t to not require an option. Closes 7466
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-25 22:10:32 +02:00
Denys Vlasenko
054f5a5b0d install: fix help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 22:16:24 +02:00
Miroslav Lichvar
590a22cf8d ntpd: split out poll adjusting code
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 15:37:17 +02:00
Miroslav Lichvar
fb143f783d ntpd: don't wait for good offset before disabling burst mode
The burst mode needs to be stopped even when no replies are received.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 15:21:18 +02:00
Aaro Koskinen
0f78d616cb install: implement -t DIR
Some packages want to install themselves using "-t" to specify
the directory (as supported by GNU coreutils). Add support for the option
for compatibility reasons.

function                                             old     new   delta
install_longopts                                      76      95     +19
install_main                                         769     777      +8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 27/0)               Total: 27 bytes

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 02:52:08 +02:00
Aaro Koskinen
307d26c0eb less: make -E work
function                                             old     new   delta
buffer_print                                          71     104     +33

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-23 22:58:18 +02:00
Denys Vlasenko
865814a617 less: trivial code shrink
function                                             old     new   delta
read_lines                                           715     695     -20

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-22 21:17:24 +02:00
Denys Vlasenko
d6e7672545 less: move "retry-on-EAGAIN" logic closer to read ops
This makes "G" (goto end of input) command work as well as
/search_for_nonexistent_string: both will read to EOF now
even from somewhat slow input (such as kernel's "git log").

function                                             old     new   delta
ndelay_on                                             35      43      +8
ndelay_off                                            35      43      +8
read_lines                                           695     691      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 16/-4)              Total: 12 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-22 21:14:02 +02:00
Denys Vlasenko
15943c886d less: disable "suppress empty wraparound" optimization
It is buggy wrt another use case...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-21 22:10:55 +02:00
Ari Sundholm
fbdc167f27 df: fix -T option when ENABLE_FEATURE_HUMAN_READABLE=0
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-20 18:55:17 +02:00
Denys Vlasenko
cd7a38a87d false: make "false --help" exit with 1
function                                             old     new   delta
run_applet_no_and_exit                               447     445      -2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-18 00:47:05 +02:00
Ari Sundholm
d0cdacafa9 df: implement -T option
function                                             old     new   delta
df_main                                              863     998    +135
packed_usage                                       29827   29861     +34
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 169/0)             Total: 169 bytes

Signed-off-by: Ari Sundholm <ari@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-17 20:53:58 +02:00
Denys Vlasenko
9caea2448e sed: fix a buglet in s///NUM handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-16 01:11:13 +02:00
Denys Vlasenko
7666fa1d02 ftpd: make LIST command show dotfiles too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-15 23:35:58 +02:00
Denys Vlasenko
05399fc53d vi: fix incorrect memory access on brace matching. Closes 7256
While at it, fix brace matching to actually show the match
(missed fflush was causing cursor positioning to be buffered);
shorten brace matching code; remove unused macro indirection
in indicate_error().

Custom linker script 'busybox_ldscript' found, using it
function                                             old     new   delta
indicate_error                                         -      61     +61
mysleep                                               43      56     +13
char_insert                                          483     486      +3
find_pair                                            167     124     -43
Indicate_Error                                        61       -     -61
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 2/1 up/down: 77/-104)           Total: -27 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-15 17:06:10 +02:00
Denys Vlasenko
26a8b9f196 mdev: treat zero-length /dev/mdev.seq the same as "\n" one. Closes 7334
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-08 18:19:15 +02:00
Denys Vlasenko
07f7ea70ed ash: fix off-by-one in "jobs %4" handling. closes 7310
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-08 17:21:52 +02:00
Denys Vlasenko
2ec34969e7 ash: factor out ASH_HELP config option
It used to be aliased to !FEATURE_SH_EXTRA_QUIET for ash,
while hush had it separate from FEATURE_SH_EXTRA_QUIET.

Bring ash in line with hush.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-08 16:52:39 +02:00
Denys Vlasenko
3e9b13e4c5 find: support -perm /BITS. Closes 7340
function                                             old     new   delta
parse_params                                        1487    1497     +10
func_perm                                             57      61      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 14/0)               Total: 14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-05 12:16:15 +02:00
Denys Vlasenko
4eb1e425fe tftpd: tweak HP PA-RISC firmware bug compatibility
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-04 12:24:03 +02:00
Denys Vlasenko
67e01fecce tftpd: support full 512-byte requests
Some HP PA-RISC firmware always sends fixed 512-byte requests,
with trailing garbage.

function                                             old     new   delta
tftpd_main                                           578     572      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-03 18:35:38 +02:00
Denys Vlasenko
f02c52bcde taskset: fix logic error in "if it doesn't start with 0x..."
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-31 01:35:45 +02:00
Denys Vlasenko
34cc6c91a2 grep: fix "grep -r PATTRN SYMLINK_TO_DIR"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-28 15:50:09 +02:00
Florian Fainelli
6ff0551157 ping: add -p to specify data pattern
function                                             old     new   delta
common_ping_main                                    1788    1831     +43
sendping6                                             56      82     +26
sendping4                                             82     108     +26
packed_usage                                       29959   29938     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 95/-21)             Total: 74 bytes

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-27 16:01:25 +02:00