Age | Commit message (Collapse) | Author |
|
|
|
|
|
Set SO_REUSEADDR when listening so that we can immediately reuse ports
that are no longer being listened upon, instead of having to wait 60
seconds for the socket to be shutdown after being closed (even on
localhost!).
|
|
|
|
|
|
into display function, use unsigned length so output lines can be up to 4g each.
|
|
|
|
I accidentally added a tab in xargs.c, so as penance I'll clean up all
the tabs.
|
|
Broke the bionic build:
external/toybox/toys/net/netcat.c:188:37: error: incompatible pointer types assigning to 'sigjmp_buf *' (aka 'long (*)[33]') from 'jmp_buf *' (aka 'long (*)[32]') [-Werror,-Wincompatible-pointer-types]
if (toys.optflags&FLAG_L) NOEXIT(child = XVFORK());
^~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/lib/lib.h:375:19: note: expanded from macro 'NOEXIT'
#define NOEXIT(x) WOULD_EXIT(_noexit_res, x)
^~~~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/lib/lib.h:367:16: note: expanded from macro 'WOULD_EXIT'
toys.rebound = &_noexit; \
^ ~~~~~~~~
1 error generated.
|
|
Not yet setting, no server/multicast, should validate source address...
|
|
If table grows >64 entries XX needs to change, but it can't be 128 yet
because the slot value is a signed char. Currently 59 entries in table...
|
|
Only -d and -f should cause a DNS lookup. The rest should just act
directly on the result of gethostname(3). Encountered with the AOSP
buildbots' use of nsjail, but tested with both the Debian hostname and
toybox hostname thus:
```
unshare -Uunr sh
hostname android-build
hostname
hostname -s
hostname -d
hostname -f
```
(Not sure how to add that to the tests.)
Also fix a SEGV with -s if the hostname doesn't contain a '.'.
Also switch to the FLAG() macro.
Also add the missing -s to the synopsis.
Bug: http://b/123123255
|
|
Implement -p, -t, and -r.
Add some missing tests.
Move -L and -x back to TODO since they're not implemented and I haven't
yet even understood what they're supposed to do.
|
|
|
|
|
|
|
|
Patch dates are optional these days, and I should properly work back from the
end and only peel off properly formatted tab+date, but "tab followed by
digit" is probably good enough and nobody's ever complained about just tab.
And we still don't support patching filenames with newlines in them...)
|
|
|
|
Used in the AOSP x86 host build.
|
|
Used to construct SELinux policies in the AOSP build.
I left loopfiles_lines with its hard-coded '\n' because although cut(1)
also has a -z option, I can't find any case where it's used in any of
the codebases searchable by me. (And fmt(1), the other user, doesn't
even have the option.) YAGNI.
Bug: http://b/122744241
|
|
|
|
For a definition of "fix" that's even _more_ of a deviation from posix, but
matches what debian does...
|
|
Used by AOSP build.
Also switch to new FLAG macro.
Bug: http://b/122739027
|
|
Without this change, a successful modprobe on Android exits with status 1
because Android doesn't have /etc/modprobe.conf or /etc/modprobe.d/ ---
neither of which seem to be required on desktop Linux either.
|
|
|
|
It's in the Linux 4.20 kernel headers.
|
|
If we do, we won't flush, and we might not output everything.
|
|
Otherwise in verbose mode we output bogus errors instead of `Success`.
|
|
Previously, when trying to listen on a socket without using one of -4,
-6, or -s, we tried to create an AF_UNSPEC socket, which fails.
|
|
|
|
|
|
|
|
From RFC 768, if UDP packet checksum computation yields a result of
zero, change it to hex 0xFFFF. The current udhcpc checksum verification
would yield false positive for this case. A better way is to compute the
checksum with the original checksum field and the result should be zero
for good udp packet.
Signed-off-by: Yangchun Fu <yangchun@google.com>
|
|
|
|
|
|
Internally, Google uses all the longopts; Android currently only uses
this one. I was tempted to add the others, but went with "add them when a
toybox user needs them" rather than "add them when you've seen them used".
|
|
Annoyingly coreutils and busybox both have the --status functionality,
but coreutils only accepts --status and busybox only accepts -s. Although
all extant users known to me use --status I've supported both (a) for
maximum compatibility and (b) because Rob hates longopts :-)
Also, -c/--check don't take argument(s): they alter the interpretation
of all the FILE... arguments.
I removed a bunch of dead code here, but I couldn't switch us over to
loopfiles_lines because I didn't want to regress on the "warn if any
check file contains no hashes", and loopfiles_lines doesn't give you
any way to recognize that you've moved on to the next file.
|
|
|
|
|
|
Handling -e by gluing together multiple regexes with | wasn't portable,
break down and do a linked list with for loops.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When necessary, realloc() the line to add 4 aligned bytes of storage at
the end, stick the unsigned offset in there, and then fish it back out for
display (and add 1 because offset is 0 based and display is 1 based).
|
|
|
|
Several parameters common on Linux are missing on macOS.
|
|
|