Age | Commit message (Collapse) | Author |
|
LTP uses `top -d 0.1`, which isn't convincingly useful, but general
support for other time units might be useful, and switching to xparsetime
addresses both at once.
Also fix 3169d948c049664bcf7216d4c4ae751881099d3e where I mistakenly
treated `rev` and `toys.optflags&FLAG_b` as interchangeable. (Without
this second fix, `top -b` looks fine but `top` is broken!)
Also fix xparsetime to reject input such as "monkey" or "1monkey".
|
|
Reuse create_uuid, but make it match the current RFC.
|
|
|
|
|
|
Note: ubuntu will show -m through a file, this treat that as error.
|
|
|
|
|
|
|
|
|
|
|
|
clang is fine with the noreturn nature of error_exit, but only if we don't
`if (false)` it out for non-debug builds.
lib/args.c:304:18: error: variable 'temp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
} else if (CFG_TOYBOX_FLOAT && new->type == '.') {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/generated/config.h:11:26: note: expanded from macro 'CFG_TOYBOX_FLOAT'
^
external/toybox/lib/args.c:308:19: note: uninitialized use occurs here
options = --temp;
^~~~
external/toybox/lib/args.c:304:14: note: remove the 'if' if its condition is always true
} else if (CFG_TOYBOX_FLOAT && new->type == '.') {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/lib/args.c:255:15: note: initialize the variable 'temp' to silence this warning
char *temp;
^
= NULL
|
|
Found by the compiler, not me:
lib/lib.c:1053:30: warning: 'st2.st_dev' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) continue;
~~~^~~~~~~
|
|
|
|
|
|
If we have a 15-byte name, we don't know whether comm actually matches
or is a truncated form of a longer name that has a common prefix.
For example, with "this-is-a-very-long-name-that-is-too-long", we shouldn't
match "this-is-a-very-" (but the old code would).
The cmdline code was also broken on Android because it used basename(3)
rather than getbasename. This doesn't affect glibc because there's a
workaround in portability.h to ensure that we get the non-POSIX basename(3)
with glibc but then a non-glibc section that ensures everyone else gets
POSIX basename(3). That should probably be removed (and maybe `basename`
poisoned) to prevent similar mistakes in future.
Bug: http://b/73123244
|
|
Requires echo 0 $((1<<30)) > /proc/sys/net/ipv4/ping_group_range (as root)
|
|
|
|
|
|
stuff syslog.h does into lib.c and portability.h
|
|
terminates parsing of Config.in at first blank line. This is because
getdelim() in portability.c returns -1 whenever the line comprises only
a single linefeed character. Fixing this was a trivial change to two lines
(see below), and config2help now works on OS X but I haven't regression
tested this on any other commands which rely on getdelim()"
|
|
|
|
Found running LTP file system tests on Android.
Bug: http://b/70627145
|
|
Before:
toy: Unknown option p (See "toy --help")
After:
toy: Unknown option p (see "toy --help")
|
|
|
|
of utf8 support (not finished yet)...
Adds new loopfiles_lines() wrapper to lib.c that calls do_lines from loopfiles.
|
|
This avoids "xargs: exec echo: Argument list too long" errors in practice.
find(1) needs to be fixed too, but that's a bit more complicated and a working
xargs provides a workaround.
Bug: http://b/65818597
Test: find /proc | strace -f -e execve ./toybox xargs echo > /dev/null
|
|
|
|
program to compare against libc output.
|
|
scripts/*.c builds against lib.c but not linestack.c.
|
|
or care about locale.
|
|
|
|
|
|
|
|
(According to the git history I added "b" for "od" but the man page says 512
there too.)
|
|
|
|
full help text, and put it back in the args constraint failures.
|
|
Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure.
Every use of mmap in toybox was either doing the wrong check, or no check
at all (including the two I personally added).
|
|
|
|
|
|
|
|
See http://lists.busybox.net/pipermail/buildroot/2016-December/180102.html
for a full post-mortem on the project.
|
|
|
|
|
|
and make uptime use it.
|
|
Recent-ish clang doesn't like self-assignment. Google/Android code always
uses the [template-based moral equivalent of] __attribute__((__unused__))
to keep both compilers happy.
|
|
I never use these, so I didn't notice I'd broken them until someone who
does bringup complained.
The "one weird trick" with SEEK_DATA is documented at the URL we already
point to. SEEK_DATA was added in Linux 3.1 (2011) and isn't available in
glibc 2.19 (2014), so I've added that to "portability.h" for the benefit
of Ubuntu 14.04.
Also make -c and -C mutually exclusive.
Also fix some of the formatting I introduced earlier. (A clang-format file
would help prevent these mistakes...)
|
|
|
|
Once upon a time you could call fchown() and let it fail. Then gcc decided
not using its return code was inconcievable, but you could typecast it to (void)
to shut it up. Then gcc noticed people doing that and clutched its pearls and
took it away, so I added an if() statement that does nothing with the result
because we _expect_ this to fail when we're not root. Then clang started
complaining about an if (); statement with the semicolon on the same line,
but decided it's ok if the ; is on the next line (I.E. significant whitespace
in C), so I'm adding an "assignemnt to self" that gets optimized away so
it does a more _explicit_ nothing (the same way you suppress gcc's broken
"this isn't used uninitialized" warnings).
If the compilers weren't going to so much trouble to force the issue I might
add code to only call fchown when we're UID 0, but I refuse to be coerced
into it. (And if getpid() is still a system call instead of a vdso member
then it doesn't actually _save_ us anything, the dentry should be hot and
the permission check was just "if (!uid)" before selinux entered into it and
we're operating on an fd so the security's the same.)
|
|
an array index, which doesn't work as a local variable name. So rename it.
|
|
__attribute__((returns_twice)) instead of noinline.
Yes LLVM supports it: https://llvm.org/bugs/show_bug.cgi?id=6287
|