Age | Commit message (Collapse) | Author |
|
|
|
This makes it more likely that you can actually debug something like
"sed: bad regex: empty (sub)expression" or
"sed: bad regex: parentheses not balanced" from a build failure log,
where you don't necessarily know where the failure came from.
This also seems like it might be useful generally, although GNU grep
doesn't include this detail in its error messages, and busybox doesn't
even seem to notice that regcomp() failed?
(Realistically if the Android build team wants to move forward with "one
true regex implementation", we're going to have to add some GNU-isms to
the Android regex implementation. But we'd need to find them first! Note
that the two examples given above are real examples from failed buildbot
builds, but they occur early in the respective builds so there are
likely many more to look at after these. Interestingly, the first of the
two appears to be the more general case of something disallowed by POSIX
that xregcomp() already has a workaround for.)
|
|
|
|
|
|
This round trip occurs in practice with $KBUILD_BUILD_TIMESTAMP in
kernel builds.
|
|
Some of the grep tests were still failing because we weren't flushing
stdout --- xflush takes a bool that says whether to actually flush, so
we need to pass 1, not 0.
|
|
This is why the tests have been failing since
42303209f44a335025b9cd1dbe5dd2f3069f2e99.
|
|
|
|
|
|
|
|
Requested in https://github.com/landley/toybox/issues/130, quoting an
old version of the toybox help. This is also supported by coreutils.
Set $LANG to C in the date tests so that they pass with TEST_HOST=1
(they were already failing for me, presumably related to a newer glibc).
|
|
|
|
|
|
|
|
|
|
Some of the bringup folks are debugging RTC issues and asked for this.
Rather than duplicate the weird xtzset dance with mktime, I've factored
that out into a new xmktime that takes a boolean for whether to use UTC
or local time.
Otherwise, the slight cleanup of hwclock.c is entirely optional. The
only functional change there is that util-linux 2.34's hwclock uses ISO
time format, which is the usual toybox preference anyway, so I've
switched it over to that rather than ctime(3).
Bug: http://b/152042947
|
|
|
|
|
|
|
|
but --restrict checking should run on the path up to the last component
before unlinking so tar can't be tricked into deleting random files off
the system.
|
|
xwaitpid(), fix off by one in xwaitpid().
|
|
|
|
No current caller except grep needs this, but consistency seems like a
good idea.
Also change the xregcomp error message to be a bit more human-readable,
rather than mention an implementation detail.
|
|
|
|
|
|
|
|
|
|
|
|
and tweak a couple comments.
|
|
SELinux on Android is unhappy if you try to read "/":
avc: denied { read } for name="/" dev="dm-3" ino=2 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
That could happen via the open of ".." too, and potentially any other
directory might have similar restrictions, so move all of the open calls
to using O_PATH.
O_PATH seems more intention-revealing given what this function is doing anyway.
|
|
SELinux on Android is unhappy if you try to read "/":
avc: denied { read } for name="/" dev="dm-3" ino=2 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
O_PATH seems more intention-revealing anyway.
|
|
and fix tests to pass on host too.
|
|
|
|
Now there's a second user... the libc function already null terminates
at len+1, and it doesn't malloc the full size if strlen() smaller so
the redundant termination stomped unallocated memory. Oops.
sort.c never noticed because it calculated length to truncate or copy
existing string, so never hit this.
|
|
|
|
|
|
|
|
stdin/stdout filehandles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xparsetime() not to need floating point, adjust callers.
|
|
|
|
xsignal() wraps sigaction() giving control of SA_RESTART behavior and such.
|
|
cleanup ala fflush(0) after a normal exec() failure.
|
|
|
|
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".
|