aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
AgeCommit message (Collapse)Author
2016-03-19Make lsof 10x faster by caching /proc/net socket info.Elliott Hughes
I deliberately didn't do this first time round because for me our lsof is already 10x faster than traditional lsof, and caching means we potentially give less information about a socket that's created while we're running. It turns out that traditional lsof caches anyway, so I guess nobody cares. This also fixes a mistake where lsof used CFG_FREE instead of CFG_TOYBOX_FREE.
2016-03-17expr cleanup: simplify get_str() and free returned allocations.Rob Landley
2016-03-16expr cleanup: traverse optargs with tok instead of incrementing optargs andRob Landley
copying itinto a second variable. Also add error message for empty ( )
2016-03-16Move whitespace and curly brackets around, move reference URLs to top of file,Rob Landley
eliminate syntax_error() function (just call error_exit() directly), eliminate advance() wrapper, pipe expected error messages in test to /dev/null
2016-03-16Fix type coercion bugs in expr.Andy Chu
All tests pass now; this fixes the 2 remaining failures, including a segfault. The structure of the code has changed a lot -- instead of having a tiny function per operator, we have eval_op() which does common type coercion and then evaluates the operator. I tried writing it a couple different ways, and this was the cleanest. The OPS table now contains the operator string, precedence level, signature for type coercion, and operator ID.
2016-03-16Fix the operator precedence in expr.Andy Chu
expr now uses the precedence table specified by POSIX, implemented using the "precedence climbing" algorithm. See the references at the top of eval_expr(). This fixes 3 of 4 failing tests. I also added more tests for correct behavior and for syntax errors. This includes a new test exposing a segfault, related to type coercion.
2016-03-08Add depends on TOYBOX_FORK for various commands that need nommu conversion.Rob Landley
(This should fix allyesconfig.)
2016-03-07Cleanup pass on the dirtree infrastructure, in preparation for making rm -rRob Landley
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics, remove dirtree_start() and don't export dirtree_handle_callback(), instead offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread passing 0 for flags.)
2016-03-06wget: clean upLipi Lee
- shorten error messages - replace mk_rq with sprintf - remove struct and defines - change unsigned int to unsigned
2016-03-06Another pass at file.c: move posix-required "executable" to front of output,Rob Landley
next few fields in the order the other implementation outputs, fewer commas, fix a big where big endian executable type wasn't detected right, and fix the filehandle leak.
2016-03-02Fix file for Java class files, improve script detection, and add tests.Elliott Hughes
2016-03-02More minor cleanup (inline a function, simplify name of another).Rob Landley
2016-03-02Minor cleanup.Rob Landley
2016-03-02For years the man pages have said to #include <sys/types.h> to getRob Landley
major/minor/makedev, but glibc has vowed to break existing programs (https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html) and replace it with _another_ non-standard header (not in posix or lsb), so let's just add functions to lib/ that do the transform ourselves.
2016-03-01Use the correct types for recvfrom.George Burgess IV
The clang FORITFY implementation doesn't like pointer signedness mismatch. "What mismatch?", you say. "The historical bug in LP32 Android that left it with a signed socklen_t".
2016-02-29do_regular_file() prints output line, don't fall through to print default.Rob Landley
2016-02-29Fix inverted test.Rob Landley
2016-02-29pending/file: add cpio, tar, zip formats.Isaac Dunham
2016-02-29Fix a typo from last time, and Isaac Dunham's todo list:Rob Landley
- per POSIX, 'cannot open' must be in the 'type' string if open() fails (both EPERM and ENOENT); we only do that if open() succeeds and fstat(fd) fails. - symlink detection (as per POSIX) won't work: opening them O_RDONLY results in following the link, then we fstat() the fd. - file 'FIFO' causes a hang; open() won't return till there's a writer.
2016-02-29Second pass at the ELF type table.Rob Landley
2016-02-22implement simple 'wget' and port name can be specified in URL if defaultLipi C. H. Lee
port 80 is not used.
2016-02-21lsof cleanupRob Landley
Accept multiple -p, inline filter_matches, convert misleading "char* a, b" to "char *a, b", use readfile() to read a file, use DIRTREE_SHUTUP, don't need { } around a single line, don't modify command line environment space (which changes what ps/pgrep sees).
2016-02-17Add dynamic/static checking to file (printing dynamic linker if found).Rob Landley
2016-02-15Cleanup pass on file.c, and add detection of different ELF architectures.Rob Landley
2016-02-14Implement file(1).Elliott Hughes
Unlike the POSIX file(1), there's no magic file here, just hard-coded common (non-obsolete) file formats. Personally most of my use of file(1) is as a one-line readelf(1) summarizer, so although I assume a full POSIX file(1) is out of scope (because just the database would likely be larger than all the rest of toybox), a subset that only supports in-use file types actually covers most of the use cases I encounter personally. Also fix peek_be/peek_le.
2016-02-10toybox: tar: Fix support for long namesTom Marshall
Pathnames may be longer than the name field in the header, so use strncpy() instead of xstrncpy() to avoid bailing out. Also add unit tests to ensure proper handling of short and long pathnames. Change-Id: Id025891993746889564b479e5185cf9721b54a55
2016-02-08Add xpipe() to lib.Rob Landley
2016-01-25Fix compiler warnings in traceroute.Elliott Hughes
If we're fixing warnings in pending...
2016-01-21I cleaned up the code in 'netstat.c' as belows.Lipi Lee
- Adjust to 80 columns - remove a useless function(strchr_nul), variable, type casting and compile warnings(fgets) - clean up netstat command option condition - change useless double pointer to single point and dynamic memory allocation to static one - fix a ambiguous return type and typo
2016-01-20Add basic top support to ps.c, delete toys/pending/top.c.Rob Landley
While I'm there, pack the ps help text, break out TOP_COMMON (todo: update config2help to collate that properly), add -o CPU showing which processor this pid is running on, implement -o C (it's %cpu without the fractional part), add -o %MEM, fix header padding.
2016-01-16Move create_uuid() to lib and xpoll() to lib/net.c.Rob Landley
2016-01-14Implement most of pgrep and pkill.Rob Landley
Needs testing and a few more options connected up.
2015-12-23Factor out draw_str() and friends.Rob Landley
2015-12-19Redo linestack to handle embedded NULs.Rob Landley
2015-12-19Start of vi.Rob Landley
2015-11-08Route cleanup: whitespace and curly bracket changes.Rob Landley
2015-11-08Bugfix for route flags.Rob Landley
2015-11-08Remove TEST_ARGV() and logic to adjust irtt by "clock ticks/100" when clock ↵Rob Landley
ticks _is_ 100...
2015-11-07More route cleanup.Rob Landley
2015-11-07Let's start the route cleanup.Rob Landley
Collate some repeated increments, remove some useless coments.
2015-11-03dhcp leanup: remove flag_get() and flag_chk()Rob Landley
2015-11-03New dhcp6 command from Sameer Pradhan.Rob Landley
2015-11-02Add ps -Z.Elliott Hughes
As with ls, it doesn't seem like -Z should be guarded behind LSM availability. On a non-SELinux system, the label is always "unconfined".
2015-10-28Promote ps to posix.Rob Landley
2015-10-28Free more stuff in debug cleanup.Rob Landley
Tempted to convert the struct arg_list and ptr_len stuff to arrays and make the parsing table driven, but there's enough direct usages of each field it's not a net win.
2015-10-28Implement -suUgG and -o majfl,minfl, move uid/ruid/gid/rgid into slots[31-34]Rob Landley
and vmlck into slot[18], pass error message to comma_args(), collate -stuUgG callbacks into parse_rest().
2015-10-25Add comma_args() and factor out parse_o(), parse_t(), and parse_p() to use it.Rob Landley
Fix FLAG_w.
2015-10-25Factor out parse_o() and make -l -f and default output work on stringsRob Landley
rather than bitfields.
2015-10-25More ps work, and fill out remaining help text.Rob Landley
Fix more l/r justification, implement uname vsz vsize and stat.
2015-10-25Fix netstat build warnings.Elliott Hughes
Fixes two instances of "warning: use of logical '&&' with constant operand". Change-Id: I2bb1ba4e389f8a9e54af8ee3ab23d8849fc329f0