aboutsummaryrefslogtreecommitdiff
path: root/toys/other
AgeCommit message (Collapse)Author
2015-01-01Switch a lot of strncpy() calls to xstrncpy().Rob Landley
2014-12-31Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the ↵Rob Landley
curly brackets.) He says: In the channel selection loop, "if (TT.chan)" had been combined with a strcmp; the else conditionals were premised on if (TT.chan) alone. The help text had been only partially updated for a couple option changes.
2014-12-31Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag ↵Rob Landley
macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags). This means the flag space is no longer packed, but leaves gaps where the zeroes go. (Actual flag bit positions are the same for all configs.) Since the option parsing needs to know where the holes are, the OPTSTR values are now generated as part of flags.h with ascii 1 values for the disabled values. (So generated/oldflags.h went away.) This also means that the option string argument for OLDTOY() went away, it now uses the same arguments as the NEWTOY() it references.
2014-12-27Promote mixRob Landley
2014-12-24Teach factor to accept whitespace separated arguments (reported by Robert ↵Rob Landley
Thompson). (The diff looks bigger than it is because of reindenting.)
2014-12-23Merge catv back into cat as discussed on the list. Add comments about ↵Rob Landley
infrastructure upgrades needed to restore separate catv option.
2014-12-18Give fstype its own config symbol (separate from blkid), and fix blkid not ↵Rob Landley
using more accurate ext3/ext4 filesystem sub-type.
2014-12-13Add base64.Rob Landley
The tizen guys wanted this. Yeah, I know there's base64 code in uuencode/uudecode, but that this has -i, input lines aren't of fixed length, encode/decode are in same file, there's no prefix/suffix code, it always writes to stdout... Eliminating the code duplication wouldn't be worth the if/else I'd have to add, so I just did a new one. Factored out the base64 table init into lib.c though: that was worth sharing.
2014-12-04Add shred.Rob Landley
2014-12-02Fix bug pointed out by Elliott Hughes ("vmstat 1" should repeat endlessly), ↵Rob Landley
and remove final delay (after all output) for "vmstat 2 3" case.
2014-11-30Remove the strncpy from mountpoint, and make a lot of other changes while ↵Rob Landley
I'm here (to be described on the mailing list).
2014-11-24Tweak the "ignoring return value" fortify workaround for readlinkat.Rob Landley
We zero the buffer and if the link read fails that's left alone, so it's ok for the symlink not to be there. Unfortunately, typecasting the return value to (void) doesn't shut up gcc, and having an if(); with the semicolon on the same line doesn't shut up llvm. (The semicolon on a new line would, but C does not have significant whitespace and I'm not going to humor llvm if it plans to start.) So far, empty curly brackets consistently get the warning to shut up.
2014-11-22As long as Android's going to require fortify, fixup the warnings it generates.Rob Landley
2014-11-22Whitespace/code style.Rob Landley
2014-11-21A patch against your current ToT that builds in AOSP master.Elliott Hughes
2014-11-19Fixups for the android/bionic build probes patch.Rob Landley
The CFG_* symbols are always defined so if() can use them as compile-time constants, so don't if defined() them. Doing USE_BLAH() around variable definitions opens up the same potential for config-dependent build breaks as #ifdefs do, just make the whole command depend on the symbol for now, factor out the utmpx infrastructure later. The PTY probe was always failing because it used NULL without #including the header that defines it. Substitute 0 instead.
2014-11-19probe for getspnam(), forkpty(), utmpx, replace sethostname()Isaac Dunham
Android is missing all of these; we need to probe for some so we have a config symbol to depend on. sethostname() is easily replaced. We got termios.h via pty.h; now it's not included in configure-step tools, so we need termios.h to generate globals.
2014-10-20More static analysis fixes from Ashwini Sharma.Rob Landley
2014-10-17unshare: Fix help and option parsingAndy Lutomirski
The help text was inconsistent, and option parsing was completely broken (the options mostly did the wrong thing).
2014-10-14Use O_CLOEXEC instead of O_RDONLY to signal loopfiles_rw() to close filehandles.Rob Landley
2014-10-10acpi: implement -ctV, fix recursion, plug a small leakIsaac Dunham
* acpi_callback had blindly assumed that a path of 26 chars or more was the right depth; rely on depth from dirtree root * acpi -c shows cooling device state some backlights are set up so that they will report dimmer as higher, but that's a hardware issue that can't be sanely worked around. * acpi -t shows temperatures this implementation will pick up fan, battery temperatures, etc. (but currently not hwmon-type temperatures, or hdd temps; acpi 1.7 does not measure these either) we handle milli-C (typical) and deci-C (I've seen this on Qualcomm batteries, and not yet anywhere else) we do *not* handle deci-K yet * acpi -V shows all sensors * without saving the result of dirtree_path() to free later, we had a slow leak. all callbacks call this once, so save it in GLOBALS() acpi -t happens to need this anyhow, though using openat()/readall() instead of readfile() would work.
2014-10-09Various bugfixes (mostly resource leaks) from Ashwini Sharma's static ↵Rob Landley
analysis, plus occasional tweak by me while reviewing them.
2014-09-17Cleanup pass on README.Rob Landley
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.
2014-09-14Split xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether ↵Rob Landley
we want to redirect both, one, or neither of stdin/stdout.
2014-09-08Don't close device handle until after calling flush ioctls, reported by ↵Rob Landley
Ashwini Sharma.
2014-08-23Promote blockdev to other.Rob Landley
2014-08-20Promote inotifyd to other.Rob Landley
2014-08-12Patches to commands for issues reported from static analysis tool.Ashwini Sharma
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it. Makefile.patch - for cleaning generated/*.o files and libopts.dat file [Fixup to uniq.c from Rob.]
2014-08-11Promote lspci.Rob Landley
2014-08-09Disable xopen's default O_CLOEXEC for oneit.Rob Landley
2014-08-01factor: catch integer overflow.Rob Landley
Now factor 9223372036854775783 (largest positive 64 bit signed prime) takes a couple minutes but gives the right answer.
2014-08-01Add factor.Rob Landley
I was reading http://www.muppetlabs.com/~breadbox/txt/rsa.html and it mentioned "factor" and I noticed it was in coreutils. I'm not sure why it's in coreutils, but it's pretty trivial, so...
2014-07-30As long as I had to write xabspath(), no point in wrapping realpath().Rob Landley
2014-07-26Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still ↵Rob Landley
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
2014-07-06Add nbd-client.Rob Landley
2014-06-30Promote makedevs to other.Rob Landley
2014-06-28Make fallocate depend on probe for libc support.Rob Landley
2014-06-28Promote mkpasswd from pending to other.Rob Landley
2014-06-11Cleanup pass on loginRob Landley
2014-06-11Enable fallocate in defconfig.Rob Landley
2014-06-09Promote rfkill.Rob Landley
2014-06-02Help text should have a blank line after usage: lines, and a couple other ↵Rob Landley
whitespace tweaks.
2014-05-31Promote partprobe.Rob Landley
2014-05-31Introduce xfork() and make commands use it, and make some WEXITSTATUS() use ↵Rob Landley
WIFEXITED() and WTERMSIG()+127.
2014-05-29Make "losetup /dev/loop0 filename" work.Rob Landley
Sigh. Implement the complex cases and you screw up the simple cases you already tested...
2014-05-25atolx_range() is already added into lib/lib.c, in vconfig.c atolx_range() ↵Ashwini Sharma
can be used in place of locally defined strtorange() function.
2014-05-25logname and whoami are the same as id -un, so merge them.Isaac Dunham
Since the starting letters are greater than those for 'id' or 'groups', we cn just check if the first letter is greater than 'i'.
2014-05-15Promote sysctl from pending to other, default y.Rob Landley
2014-05-02Attached is the patch for lsattr and chattr implementation.Ashwini Sharma
This is the modified and better version from the last one I sent. It is having the both the mains (lsattr_main() and chattr_main() ) in single file. Also removed the dependency of additional file in lib, as common code is in the same .c file.
2014-04-23Add example directory, move hello.c into it, add skeleton.c to demonstrate ↵Rob Landley
more complciated stuff (multiple commands per file, etc), and have genconfig.sh sort backwards so posix is first and example last in menuconfig.