Felix Janda [Mon, 26 Aug 2013 19:55:33 +0000 (21:55 +0200)]
syslogd: cleanup
- fix bugs introduced in the cleanups
- inline addrfds() and open_unix_socks() and simplify them
- use xpidfile()
- remove isNetwork from struct logfile
- invert the meaning of facility and level in struct logfile so
that they are automatically correctly initialized
- fix memory leak regarding the filenames of logfiles
- TT.sd was unused
Felix Janda [Sat, 24 Aug 2013 10:04:45 +0000 (12:04 +0200)]
syslogd: cleanup
- fix bugs in previous cleanups
- remove config from struct logfile
- simplify parse_config()
Felix Janda [Fri, 23 Aug 2013 20:50:29 +0000 (22:50 +0200)]
syslogd: stop abusing arg_list
Felix Janda [Fri, 23 Aug 2013 20:19:55 +0000 (22:19 +0200)]
syslogd: cleanup
- simplify resolveconfig() -> now logger_lookup is also used in syslogd.c
- inline addrfds
- small cosmetical changes in parse_config_file()
Felix Janda [Wed, 21 Aug 2013 19:24:45 +0000 (21:24 +0200)]
syslogd: cleanup
- remove flag macros
- remove some unecessary gotos
- inline open_udp_socks() and getport()
- simplify resulting open_logfiles()
Now in the syslog.conf the port numbers for remote hosts are no
longer allowed to be hexadecimal. If there is need for hexadecimal
port numbers, one can as well accept octal ones and use base 0
in strtoul.
Rob Landley [Wed, 21 Aug 2013 10:38:53 +0000 (05:38 -0500)]
Fix bug where exit code was only correct for -q.
Rob Landley [Wed, 21 Aug 2013 08:03:47 +0000 (03:03 -0500)]
Fix --help option to multiplexer.
Felix Janda [Tue, 20 Aug 2013 21:15:48 +0000 (23:15 +0200)]
syslogd: cleanup
- Remove structure fd_pair so that sigfd can go into GLOBALS
- Remove struct typedefs
- Inline setup_signal()
- Small fix in Usage message
Rob Landley [Tue, 20 Aug 2013 20:37:42 +0000 (15:37 -0500)]
Add watch and ps, sent by Ashwini Sharma.
Felix Janda [Mon, 19 Aug 2013 20:11:22 +0000 (22:11 +0200)]
In logger and syslogd remove duplicated definitions of facilities and priorities
In syslogd.c get the definitions from <syslog.h>. For logger.c we
can't do this as well since it causes multiply defined symbols.
Instead we define a non-static lookup function in syslog.c for
logger.
Rob Landley [Mon, 19 Aug 2013 09:23:16 +0000 (04:23 -0500)]
Move grep from pending to posix, switch default to y.
Rob Landley [Mon, 19 Aug 2013 08:17:51 +0000 (03:17 -0500)]
Finish grep rewrite and fleshing out test suite. Several of the grep tests fail with the ubuntu version, I _think_ these are upstream bugs? (Second opinions welcome...)
Rob Landley [Sun, 18 Aug 2013 21:12:28 +0000 (16:12 -0500)]
Use OPTSTR_command macro for more oldtoys, to avoid keeping two option strings in sync. (todo: figure out how to make OLDTOY() automatically use macro. Still need the raw version for subset ala cp/mv though.)
Rob Landley [Sun, 18 Aug 2013 19:24:59 +0000 (14:24 -0500)]
Document the toybox entry path from main() into a command.
Rob Landley [Sun, 18 Aug 2013 19:04:18 +0000 (14:04 -0500)]
Fix wrong printf type.
Rob Landley [Sun, 18 Aug 2013 19:01:46 +0000 (14:01 -0500)]
Whitespace changes to passwd.
Rob Landley [Sun, 18 Aug 2013 18:52:08 +0000 (13:52 -0500)]
Fix usage: lines for a couple commands.
Rob Landley [Sun, 18 Aug 2013 09:12:51 +0000 (04:12 -0500)]
Remove files du no longer needs.
Rob Landley [Sun, 18 Aug 2013 09:11:50 +0000 (04:11 -0500)]
Cleanup du.
Rob Landley [Sat, 17 Aug 2013 09:19:00 +0000 (04:19 -0500)]
cut tests from Kyungwan Han.
Strake [Sat, 17 Aug 2013 07:54:58 +0000 (02:54 -0500)]
su: cleanery
* make help message more like others
* s/TT\.(.)Argu/TT.\1/g
* move environ to toys.h
* simplify failure messages
* clear password before quit
* not check what execve returns
* -lc
Rob Landley [Fri, 16 Aug 2013 19:46:52 +0000 (14:46 -0500)]
Normalize df menu entry and tweak help text.
Rob Landley [Thu, 15 Aug 2013 05:58:52 +0000 (00:58 -0500)]
Forgot to check in toys.h when generated/oldtoys.h went in. (Oops.)
Rob Landley [Thu, 15 Aug 2013 00:09:33 +0000 (19:09 -0500)]
DHCP client and server, from Ashwini Sharma.
M. Farkas-Dyck [Tue, 13 Aug 2013 09:17:34 +0000 (04:17 -0500)]
Add su.
Rob Landley [Tue, 13 Aug 2013 08:22:44 +0000 (03:22 -0500)]
Add a new optimization flag at the suggestion of the musl guys telling gcc not to produce a large unused dwarf table for C++ style stack unwinding.
Rob Landley [Mon, 12 Aug 2013 09:28:03 +0000 (04:28 -0500)]
More grep tests, remove obsolete comment.
Rob Landley [Mon, 12 Aug 2013 08:16:29 +0000 (03:16 -0500)]
grep: -om counts matching lines, not matching parts of lines.
Rob Landley [Mon, 12 Aug 2013 08:08:56 +0000 (03:08 -0500)]
More grep work: name "(standard input)" correctly, make multiple -e work, regex with embedded newline, multiple regex without -E.
Rob Landley [Mon, 12 Aug 2013 06:48:27 +0000 (01:48 -0500)]
More grep cleanup, and make OPTSTR_command macros for use with OLDTOY()
Isaac Dunham [Mon, 12 Aug 2013 03:00:36 +0000 (22:00 -0500)]
fdisk: remove goto; inline valid(); merge xprintf() calls; shrink sys_types
sys_types had used char[_PATH_MAX] for 22-char max strings.
When this is done 48 times, it nearly doubles the size of toybox.
goto should only be used when it is the easiest way to bail out.
That does not mean "when we need to fall back to returning a one-liner
that asks user input", nor is it suitable for looping:
C has while () and do { } while (); for a reason.
valid was called once. As such, it belonged inline.
print_*menu could probably be inlined, but I did not do this yet
in case a table-driven approach works better.
This uses C string concatenation to break an overly long message up,
while not wasting function calls.
Rob Landley [Mon, 12 Aug 2013 02:56:08 +0000 (21:56 -0500)]
Ashwini Sharma said that Kyungwan Han should be in the contact info for the commands he sent recently.
Rob Landley [Sun, 11 Aug 2013 06:03:26 +0000 (01:03 -0500)]
More grep tests.
Felix Janda [Sat, 10 Aug 2013 18:18:18 +0000 (20:18 +0200)]
Add daemonize function to lib for klogd and syslogd
Felix Janda [Sat, 10 Aug 2013 17:35:11 +0000 (19:35 +0200)]
Cleanup klogd
Remove #if and inline most functions
Felix Janda [Fri, 9 Aug 2013 18:46:02 +0000 (20:46 +0200)]
New toy: fallocate
Rob Landley [Thu, 8 Aug 2013 07:46:45 +0000 (02:46 -0500)]
Achille Fouilleul pointed out that fdlength wasn't returning the right length in the binary search case.
(This code was originally written for mke2fs, and applies to block devices. The regular file case should just return the length from stat. The ioctl is left commented out in case I want to add back code to check the size of CDROMs without spinning them up again; not sure the sector size is always right these days.)
Rob Landley [Wed, 7 Aug 2013 17:19:51 +0000 (12:19 -0500)]
Forgot to check in xfdopen(). My bad.
Failure of fdopen() is most likely failure of malloc() for the FILE structure.
Isaac Dunham [Wed, 7 Aug 2013 16:51:26 +0000 (11:51 -0500)]
This is the preliminary version of lspci text output support (the location
of pci.ids is hard-coded to /usr/share/misc/pci.ids, as found on Debian/Ubuntu).
+88 lines in two files, including reformatting, comments, whitespace,
and build configuration as well as new code.
The changes:
-Add library code to look up descriptions.
-Add a counter for -n (for the sake of -nn)
-Add the file stream "db" to GLOBALS and open it conditionally
-Add name fields to bufs
-Look up text if enabled and -n is passed never or twice
-Print text if lookup succeeded
Ashwini Sharma [Mon, 5 Aug 2013 18:16:03 +0000 (13:16 -0500)]
I have implemented FDISK command.
This supports '-l' option for listing and other options [-bCHS] for giving
values like block size, Cylinders, Heads,...
Rob Landley [Sun, 4 Aug 2013 20:04:08 +0000 (15:04 -0500)]
Fluff out grep test suite some more, including lots of things we don't pass yet.
Rob Landley [Sun, 4 Aug 2013 06:22:49 +0000 (01:22 -0500)]
Cleanup grep, make it pass the current test suite.
Rob Landley [Sun, 4 Aug 2013 05:31:27 +0000 (00:31 -0500)]
System V style init, submitted by Kyungwan Han.
Rob Landley [Thu, 1 Aug 2013 23:15:20 +0000 (18:15 -0500)]
Need to specify bool for CP_MV_MORE config symbol to avoid warnings.
Rob Landley [Thu, 1 Aug 2013 23:10:47 +0000 (18:10 -0500)]
ls --color should depend on LS in menuconfig.
Rob Landley [Thu, 1 Aug 2013 22:21:38 +0000 (17:21 -0500)]
Cleanup grep: help text, whitespace, add parentheses.
M. Farkas-Dyck [Thu, 1 Aug 2013 20:46:45 +0000 (15:46 -0500)]
Found the fault. My method of -w fails sans -E, so I just disallow it.
Kernel build never uses -w sans -E anyhow.
Rob Landley [Thu, 1 Aug 2013 20:22:52 +0000 (15:22 -0500)]
Clean up grep.test to use "infile" properly, and not try to work around the $PATH behavior of scripts/test.sh. Tested with both TEST_HOST=1 and normal.
Ashwini Sharma [Thu, 1 Aug 2013 06:52:32 +0000 (01:52 -0500)]
I add testsuite for grep.
It can test grep's option basically and I think it can help to check progress of development.
Rob Landley [Wed, 31 Jul 2013 21:36:57 +0000 (16:36 -0500)]
Move renice from pending to posix, default y, fix link to standard.
Rob Landley [Wed, 31 Jul 2013 08:24:58 +0000 (03:24 -0500)]
Cleanup renice and implement '|' (required option) in argument parsing.
M. Farkas-Dyck [Tue, 30 Jul 2013 02:16:55 +0000 (21:16 -0500)]
Add renice.
Felix Janda [Sat, 27 Jul 2013 07:45:40 +0000 (09:45 +0200)]
Fix lspci -e
Strake [Fri, 26 Jul 2013 23:23:08 +0000 (18:23 -0500)]
add nl
Ashwini Sharma [Mon, 29 Jul 2013 05:42:30 +0000 (00:42 -0500)]
The attached KLOGD patch is an improved version of the one you have in hg.
This also has a fix for boundary condition crash.
Felix Janda [Wed, 24 Jul 2013 22:48:29 +0000 (00:48 +0200)]
logger: Some cleanup
Strake [Sat, 27 Jul 2013 05:50:29 +0000 (00:50 -0500)]
grep: s/astrcat/x&/g
Strake [Sun, 8 Jun 2003 15:15:17 +0000 (10:15 -0500)]
grep: add -b flag
Strake [Sun, 8 Jun 2003 15:09:05 +0000 (10:09 -0500)]
grep: add -w flag
Felix Janda [Sat, 27 Jul 2013 03:49:05 +0000 (22:49 -0500)]
lspci: use toybuf instead of dynamic memory allocation
Isaac Dunham [Fri, 26 Jul 2013 20:41:31 +0000 (15:41 -0500)]
I've written an lspci implementation.
Currently it supports -emkn; -e is an extension ("class" is a 24-bit number,
but lspci only shows 16 bits; one person on the Puppy forums mentioned
that they need those last 8 bits).
-n is a no-op for compatability with standard lspci.
Isaac Dunham [Fri, 26 Jul 2013 18:27:27 +0000 (13:27 -0500)]
This removes xz_mode.
Mostly outdated comments and unused function parameters/struct members.
Rob Landley [Fri, 26 Jul 2013 18:04:21 +0000 (13:04 -0500)]
Link to Georgi's mirror on github.
Rob Landley [Fri, 26 Jul 2013 03:41:26 +0000 (22:41 -0500)]
Juhani Haverinen pointed out that python 3 doesn't work with config2help.py, so you python2 binary until finishing the C rewrite.
Felix Janda [Thu, 18 Jul 2013 23:18:22 +0000 (01:18 +0200)]
Implement test
Rob Landley [Thu, 25 Jul 2013 18:49:58 +0000 (13:49 -0500)]
Don't make a FLAG_ macro for " ", it's a control character, doing so throws the indexes off. Reported by Ashwini Sharma.
Rob Landley [Thu, 25 Jul 2013 18:32:06 +0000 (13:32 -0500)]
pgrep and pkill by Madhur Verma,
Rob Landley [Thu, 25 Jul 2013 18:30:58 +0000 (13:30 -0500)]
netstat by Ranjan Kumar.
Rob Landley [Thu, 25 Jul 2013 18:28:53 +0000 (13:28 -0500)]
syslogd by Madhur Verma.
Strake [Wed, 24 Jul 2013 01:19:31 +0000 (20:19 -0500)]
grep
Rob Landley [Mon, 22 Jul 2013 06:54:28 +0000 (01:54 -0500)]
More ifconfig cleanup: Remove if_list, unify get_device_info and display_ifconfig(), inline another magic constant #define that's only used once.
Rob Landley [Fri, 19 Jul 2013 10:33:36 +0000 (05:33 -0500)]
Another round of ifconfig cleanup.
Rob Landley [Fri, 19 Jul 2013 07:03:02 +0000 (02:03 -0500)]
Start of TOYBOX_SINGLE support, for building standalone commands with no multiplexer.
Rob Landley [Thu, 18 Jul 2013 23:20:03 +0000 (18:20 -0500)]
Replace users of xexec(toys.optargs) with xexec_optargs(0) to avoid free/reuse bug during argument parsing.
Isaac Dunham [Wed, 17 Jul 2013 22:27:14 +0000 (17:27 -0500)]
make xzcat use loopfiles(), thereby allowing regular usage.
Isaac Dunham [Wed, 17 Jul 2013 22:25:07 +0000 (17:25 -0500)]
xzcat: remove XZ_(PREALLOC|SINGLE), inline xz_dec_bcj_create
Because we only use XZ_DYNALLOC, there's a bunch of dead code.
This patch removes the #ifdef's and if()s associated with support for
multiple modes.
single_call was only used to store the mode; it is no longer needed.
A little bit of reorganization was needed to reduce the number of prototypes.
Documentation associated with dead code was dropped.
There are still some relics of multiple modes in the continued presence
of "XZ_DYNALLOC" and xz_mode.
Additionally, I inlined xz_dec_bcj_create; it was called once.
This loses about 125 lines, mostly comments.
Rob Landley [Wed, 17 Jul 2013 22:22:46 +0000 (17:22 -0500)]
Add timeout, factoring out common code from sleep.
Rob Landley [Tue, 16 Jul 2013 05:04:56 +0000 (00:04 -0500)]
Split lib/xwrap.c from lib/lib.c
Rob Landley [Mon, 15 Jul 2013 18:12:08 +0000 (13:12 -0500)]
klogd, submitted by Ashwini Sharma.
Rob Landley [Mon, 15 Jul 2013 03:12:22 +0000 (22:12 -0500)]
New stuff added to lib.c needs review too, so make a lib/pending.c and move several functions to it.
Strake [Fri, 12 Jul 2013 23:10:52 +0000 (18:10 -0500)]
add grep
Rob Landley [Fri, 12 Jul 2013 03:38:29 +0000 (22:38 -0500)]
Eject cleanups.
Rob Landley [Thu, 11 Jul 2013 23:02:54 +0000 (18:02 -0500)]
Eject, by Kyungwan Han.
Isaac Dunham [Thu, 11 Jul 2013 02:26:49 +0000 (21:26 -0500)]
add paramtype in to the list of tags
Isaac Dunham [Sat, 6 Jul 2013 16:26:15 +0000 (11:26 -0500)]
This inlines CRC64, and nothing more.
The functions involved were called only once.
Felix Janda [Wed, 3 Jul 2013 07:29:24 +0000 (02:29 -0500)]
here's a version of paste. It doesn't deal with wide characters yet and
likely behaves very badly when given too many files or delimiters.
Rob Landley [Tue, 2 Jul 2013 05:16:16 +0000 (00:16 -0500)]
Added tag 0.4.5 for changeset
62ba5ce62e9d
Rob Landley [Mon, 1 Jul 2013 05:10:28 +0000 (00:10 -0500)]
Make ls output major, minor for block devices.
Rob Landley [Mon, 1 Jul 2013 04:52:45 +0000 (23:52 -0500)]
First pass at ls --color
Rob Landley [Sun, 30 Jun 2013 21:52:57 +0000 (16:52 -0500)]
Condense ls help text.
Rob Landley [Sun, 30 Jun 2013 20:58:24 +0000 (15:58 -0500)]
Add config option for --help support in all commands.
Rob Landley [Sun, 30 Jun 2013 06:26:56 +0000 (01:26 -0500)]
Fix another segfault in ls -C when terminal size is 0x0.
Isaac Dunham [Fri, 28 Jun 2013 07:11:48 +0000 (02:11 -0500)]
modinfo: support -b basedir and -k kernel.release, fix two bugs
Add two less-frequently used flags for modinfo; -b specifies an alternate
root and -k replaces the output of uname -r.
Additionally, avoid a potential overflow in sprintf,
and correct an inverted test.
Rob Landley [Thu, 27 Jun 2013 04:22:43 +0000 (23:22 -0500)]
Update status to include recently implemented commands.
Rob Landley [Sun, 23 Jun 2013 19:38:31 +0000 (14:38 -0500)]
Modinfo cleanups.
Don't use xopen() if you want to iterate through multiple files.
Don't abort if unable to open the file, but return error if it can't map it.
(And leak the filehandle.) All modinfo_file() actually uses is the filename,
no reason to go through dirtree() for that. Nothing is actually _checking_ the
return value of modinfo_file(). Avoid global data outside of toy_union.
Make sure extension is at end of file (we can add support for more extensions
later).
Isaac Dunham [Sun, 23 Jun 2013 19:02:16 +0000 (14:02 -0500)]
Patch that assumes that the presence of the string ".ko" indicates
use of a path to a module (*.ko.xz and similar included, but not supported).
Rob Landley [Sun, 23 Jun 2013 04:30:07 +0000 (23:30 -0500)]
Implement mv as an extension of cp.
Rob Landley [Sat, 22 Jun 2013 20:36:25 +0000 (15:36 -0500)]
Option type @ counts number of occurrences, it doesn't take an argument.
Rob Landley [Sat, 22 Jun 2013 19:23:06 +0000 (14:23 -0500)]
Generate FLAG_longopt macros for --longopts with no corresponding short option.
Rob Landley [Tue, 18 Jun 2013 23:13:06 +0000 (18:13 -0500)]
Add pivot_root.