Age | Commit message (Collapse) | Author |
|
analysis, plus occasional tweak by me while reviewing them.
|
|
We xstrdup() an optargs string to avoid modifying our environment space
(because it can change what "ps" shows to other processes), and then parse
out colon delimited strings and save them in globals that can later be used
in the -v codepath and so on. But those globals _aren't_ strdup (no point)
which means we can't free the string while we're still using pointers into
the middle of it. So move the free to the end.
(I hardly ever test with CFG_TOYBOX_FREE switched on because even nommu
doesn't need it.)
|
|
toys/pending/README), this can be probed from the source.)
|
|
polish beyond this.)
|
|
|
|
|
|
The Linux man page says I can use AT_SYMLINK_NOFOLLOW. It works in glibc,
uclibc, and klibc, but musl returns -EINVAL any time you pass in that flag
and the maintainer says that's not a bug and insists the man page and those
other libraries all change to match musl's behavior.
Toybox uses it to avoid scheduling unnecessary metadata writes for things we're
about to delete (have to chmod unreadable directories so we can descend into
them to delete their contents, the chmod happens before we descend so the
disk I/O has plenty of time to be scheduled) because the extra writes wear out
SSD faster. It's just an optimization and I don't really care if it works
_well_ (the fchmodat call _also_ takes AT_SYMLINK_NOFOLLOW so that's covered),
but musl's behavior uniquely makes the check always error and thus breaks normal
"rm -r".
Yes this workaround is checking #ifdef __MUSL__ which the library does not
supply (because its code is perfect and will thus never need to be worked
around). You can CFLAGS=-D__MUSL__ if you don't echo "#define __MUSL__" >>
include/features.h when installing the library.
|
|
for libc, so we have to implement it here.
|
|
_route_ and _tunnel_ options.
|
|
mount, 2) Don't stop checking filesystem types due to EBUSY, it may mean already mounted by another filesystem type you haven't tried yet.
|
|
add better error reporting.
|
|
|
|
|
|
|
|
|
|
|
|
OLDTOY standalone (if it has its own config symbol).
|
|
another command's help.
|
|
(line separator), and "/" (filename separator).
Restricting usernames to the legacy posix character allowed set (for filenames,
so the $HOME directory is creatable on VFAT and similar) means you can't have
UTF-8 usernames. Linux allows any character but / and NUL in filenames.
Since root is creating these entries, we assume root knows what it's doing.
|
|
|
|
|
|
|
|
Sharma.
dirtree->name is an array, not a pointer, so can't be zero. Remove the test.
We dereference plen without checking it for null but calling dirtree_path(0, 0)
is pilot error: only the _first_ call can have plen = 0. Add a comment.
|
|
|
|
I've been locally patching uClibc to not violate posix-2008 (you don't need
to define a GNU macro to get a posix function), but uClibc is obsolete and
moribund (development peaked in 2006, last bugfix release was over 2 years
ago), and the largest remaining user (buildroot) doesn't bother to apply such
a patch. Since even buildroot is slowly migrating to musl-libc, just do the
portability tweak for what the last release of the old thing actually did.
|
|
back off if necessary.
|
|
just remove the "generated" directory entirely.
|
|
|
|
|
|
|
|
(Did you know you can test individual commands with scripts/test.sh command?
Now you do...)
|
|
It's just a word. Capitalize at the start of the sentence, otherwise don't.
Yeah, it could be always capitalized as a proper name but since the command
"toybox" is all lower case, that would be weird.
|
|
actually in the "kconfig" directory, not under scripts. Remind me to write a new one from scratch...
(Someone actually submitted a basic kconfig rewrite in awk once, but until I
bite the bullet and write my own awk.c, I just don't know awk well enough to
maintain a large script written in it. Back when I maintained kernel.org/doc
I wrote http://landley.net/hg/kdocs/file/tip/make/menuconfig2html.py but
I am NOT reintroducing python as a build dependency. And neither actually
implemented actual menuing part. So... todo list.)
|
|
and make ctrl-c kill "make test" more reliably.
|
|
try to keep large SMP machines busy (each compiler invocation is short so they exit almost as fast as we launch them).
|
|
into GLOBALS.
|
|
search.
(Fixes messages about not being able to delete directories when running make test).
|
|
|
|
Other versions are adding Cached from /proc/meminfo to free buffers/cache
(and subtracting it from used), but sysinfo() doesn't provide it. (But it
provide "high memory", which hasn't been relevant for almost a decade...)
But that's a design change, not a cleanup issue.
|
|
(grandfathered) awaiting cleanup.
|
|
|
|
Cut predates the "pending" directory, so was checked in as-is. Ashwini
Sharma's recent static analysis fixes touched this file, but there's a lot
more to do than the static analyzer found.
|
|
|
|
|
|
|
|
|
|
we want to redirect both, one, or neither of stdin/stdout.
|
|
"does it exist" test (to avoid errors on rm -f of nonexistent files) said it didn't.
The fix: replace the access() with unlink(), which produces the same "does not
exist" errno and has the added bonus of acting as a fastpath for rm -f on
non-directories. (And since it produces a different error on directories,
falls through to the old behavior there.)
Most of this commit is comment updates explaining being subtle. :)
|
|
the toybox_unstripped binary using the existing generated/*.h files.
This way we can snapshot the generated/*.{h,sh} from a defconfig build into
a "shipped" directory or something, and then people can maybe build on crazy
crippled environments like pcbsd that haven't got gmake and put bash under
/usr/local so none of the #!/scripts can find it. This solves at least
part of the "toybox can build with itself but you need to build toybox first
to have the tools to run the build scripts" problem.
Next up: work out the minimal config to provide the build tools needed
to run an actual build. (This should, eventually, include a "make" command
if freebsd's kernel is going to refuse to build with netbsd's "make" and
we don't just write off the whole thing as crazy. But it probably shouldn't
include commands that #include <linux/*.h> if we are trying to make that work.)
|
|
Clearing out old .o files needs -r now that generated/obj has its own subdirectory. (Works if you make clean between, but shouldn't need it.)
|