aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * klibc-utils: add ipconfig.c work-in-progressDenys Vlasenko2017-09-011-0/+316
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: fix a thinko in last commitDenys Vlasenko2017-08-301-1/+1
| | | | | | | | | | | | | | | | IF_FEATURE_XARGS_SUPPORT_PARALLEL(char *opt_a = NULL;) is replaced with IF_FEATURE_XARGS_SUPPORT_ARGS_FILE Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: support -a FILEJohannes Schindelin2017-08-291-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GNU-specific option -a lets xargs read the arguments from a file rather than from stdin. This is particularly convenient when debugging in gdb interactively, and it might be of more general use. function old new delta xargs_main 788 823 +35 packed_usage 31683 31671 -12 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * klibc-utils: remove accidental "or later" licensing wording.Denys Vlasenko2017-08-292-2/+2
| | | | | | | | | | | | I (slightly) prefer my code to be under "GPLv2 only" license. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc: show only short opts in --help textDenys Vlasenko2017-08-291-39/+0
| | | | | | | | | | | | | | function old new delta packed_usage 31615 31501 -114 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * i2c_tools: tweak --help textDenys Vlasenko2017-08-291-33/+36
| | | | | | | | | | | | | | function old new delta packed_usage 31624 31615 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * setpriv: placete "declaration of 'index' shadows a global declaration" warningDenys Vlasenko2017-08-291-4/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix false positive in unset.testsDenys Vlasenko2017-08-291-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: GETOPT_RESET() _after_ getopts too.Denys Vlasenko2017-08-294-5/+6
| | | | | | | | | | | | | | | | | | NOEXEC'ed applets which use getopt() need this. function old new delta builtin_getopts 403 413 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: reuse "OPTIND=..." stringDenys Vlasenko2017-08-291-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix "getopts" builtin to not be upset by other builtins calling getopt()Denys Vlasenko2017-08-295-15/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta builtin_getopts 363 403 +40 unset_local_var_len 185 215 +30 set_local_var 440 466 +26 reset_traps_to_defaults 151 157 +6 pseudo_exec_argv 320 326 +6 install_special_sighandlers 52 58 +6 pick_sighandler 62 65 +3 execvp_or_die 85 88 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/0 up/down: 120/0) Total: 120 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * i2c-tools: don't include linux/i2c-dev.hBartosz Golaszewski2017-08-291-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing headers from upstream i2c-tools makes it impossible to build the busybox version due to redefined symbols. This is caused by the fact that linux/i2c-dev.h from i2c-tools overwrites the one from linux uapi and defines symbols already defined by linux' linux/i2c.h. Drop this include and simply re-implement the relevant defines from linux/i2c-dev.h in miscutils/i2c-tools.c. Tested by building on systems with and without i2c-tools headers. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * i2c-tools: remove unneeded includeBartosz Golaszewski2017-08-281-1/+0
| | | | | | | | | | | | | | | | | | We no longer use common_bufsiz1 in i2c-tools. Don't include common_bufsiz.h. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * kill: add '--' option to separate options from argumentsRon Yorston2017-08-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a negative pid to send TERM to a process group results in an obscure error: $ ./busybox kill -12345 kill: bad signal name '12345' This is intended. Manpage says: ARGUMENTS pid Each pid can be one of four things: ... -n where n is larger than 1. All processes in process group n are signaled. When an argument of the form '-n' is given, and it is meant to denote a process group, either a signal must be specified first, or the argument must be preceded by a '--' option, otherwise it will be taken as the signal to send. However, we did not support "--". Add this capability to BusyBox. function old new delta kill_main 993 999 +6 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: optional support for -P NUM. Closes 9511Denys Vlasenko2017-08-241-18/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on patch by Johannes Schindelin <johannes.schindelin@gmx.de> function old new delta xargs_exec - 294 +294 packed_usage 31757 31772 +15 xargs_main 787 719 -68 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 309/-68) Total: 241 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: code shrinkDenys Vlasenko2017-08-241-14/+11
| | | | | | | | | | | | | | function old new delta xargs_main 827 787 -40 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: in '/regexp/cmd1;//cmd2', cmd2 should use the same regexp as cmd1Denys Vlasenko2017-08-232-4/+16
| | | | | | | | | | | | | | function old new delta get_address 165 211 +46 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: fix fallout from opt_complementary conversionDenys Vlasenko2017-08-232-7/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: more s/error/perror/ for better error reportingDenys Vlasenko2017-08-231-5/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: when cd fails, say whyJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: report reason when a script file could not be openedJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | | | | | | | It is always nicer to give the user some sort of indication why an operation failed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | timeout: use new kill(2) to signal childRon Yorston2017-09-271-7/+6
| |
* | win32: allow kill to send signal number 0Ron Yorston2017-09-271-0/+15
| | | | | | | | | | | | | | According to the man page: If sig is 0, then no signal is sent, but existence and permission checks are still performed
* | win32: improvements to implementation of kill(2)Ron Yorston2017-09-271-87/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the implementation of kill(2) so that: - Sending the TERM signal asks the target process to exit. As on Unix it may not comply. - Sending the KILL signal forcibly terminates the target process. - Using a negative pid treats the target process as a process group leader and signals it and all of its descendants. - Using a pid of zero treats the current process as a process group leader and signals it and all of its descendants. Signed-off-by: Ron Yorston <rmy@pobox.com>
* | kill: use gentler method than TerminateProcess()Johannes Schindelin2017-09-271-1/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Git for Windows' source code recently learned, let's also avoid using TerminateProcess() in BusyBox-w32: it does not allow the killed processes' atexit() handlers to run. Instead, jump through a couple of hoops by injecting a remote thread that executes the ExitProcess() function. This allows the atexit() handlers to run, at which point the exit code of the process can already be queried via GetExitCodeProcess(), and appropriate action can be taken, such as killing child processes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | ps: add support for CPU and elapsed time columnsRon Yorston2017-09-017-7/+119
| | | | | | | | | | | | | | | | It may be necessary to run ps as administrator to get information about processes belonging to other users. The code to detect GetTickCount64 at run-time was imported from Git for Windows.
* | ps: add parent process id as a supported columnRon Yorston2017-08-312-3/+4
| |
* | win32/poll: avoid assumption that pointers are equivalent to longsJohannes Schindelin2017-08-311-1/+1
| | | | | | | | | | | | | | | | | | This is a companion patch to 4319368c6 (Use gnulib poll, importing the version from git, 2012-03-30) (Git's implementation of IsConsoleHandle() was adjusted in the meantime). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | ash: stop assuming that pointers and ints are interchangeableJohannes Schindelin2017-08-311-3/+3
| | | | | | | | | | | | | | | | This is a companion patch to db169a143 (win32: ash: forkshell_init(), 2010-04-14). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | ash: avoid assumption about sizeof(long) == sizeof(void *)Johannes Schindelin2017-08-311-1/+1
| | | | | | | | | | | | | | | | This change fixes a minor bug in eea918c5e (win32: ash: spawn_forkshell(), 2010-04-14). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | dd: silence warning on 64-bit systemsRon Yorston2017-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | On 64-bit systems size_t may be larger than unsigned long, resulting in a warning when -1L is cast to size_t. There's little to be gained from allowing obs and ibs take values larger than will fit in a signed long as the subsequent malloc will probably fail. Limit their range to ULONG_MAX/2. Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32: further minor code shrinkRon Yorston2017-08-301-17/+11
| | | | | | | | | | Remove the check for argv being NULL in spawnveq. It shouldn't ever succeed.
* | win32: add a function to find executable on PATHRon Yorston2017-08-301-34/+30
| | | | | | | | | | | | The function find_executable is more generic than needed here: it can search for all matches on PATH whereas we only want the first. Implement find_first_executable to do that.
* | win32: changes to treatment of scriptsRon Yorston2017-08-301-58/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify how scripts are detected by parse_interpreter. It now: - uses strtok to parse the line buffer; - returns any options as a single string, not an array of separate options; - returns both the full path of the interpreter and its name. When a script is detected the sequence is now: - if the path to the interpreter refers to an executable run that; - else look up the interpreter name as a applet (if so configured) and run the applet found; - else search for the interpreter name on PATH.
* | win32: shrink code to detect .exe filesRon Yorston2017-08-304-31/+26
| | | | | | | | | | | | | | | | Add a function (has_exe_suffix) to replace explicit code to check if a filename ends with '.exe. or '.com'. Also shrink code that checks for '.exe' or '.com' on PATH in shell's find_command function.
* | win32: make vfork fail at compile-timeRon Yorston2017-08-303-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes.
* | libbb: exclude more Linux-specific functions from being compiledJohannes Schindelin2017-08-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 7a4491e1f (libbb: don't compile various Linux-specific functions, 2017-08-24), we started excluding a number of Linux-specific functions that handle things like SELinux, ioctls, devices and forking. But we forgot a couple functions that depend on the ones we now excluded. This leads to compile failures with -Werror unless cross-compiling on Linux, due to undefined symbols. To fix this, exclude those functions which depend on the ones that were excluded (they do not have any callers on Windows anyway, so all is good). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | libbb: don't compile various Linux-specific functionsRon Yorston2017-08-241-0/+2
| | | | | | | | | | | | | | xfuncs_printf.c includes a number of Linux-specific functions. They handle things like SELinux, ioctls, devices and forking. Nothing in busybox-w32 uses them, so don't compile them.
* | cpio: disable pass-through mode (-p) in default configurationRon Yorston2017-08-242-2/+2
| | | | | | | | Pass-through mode never worked: it uses fork().
* | mode_string: S_IFBLK differs between Windows and UnixJohannes Schindelin2017-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | It is a bit wrong to make that much of a hard-coded assumption, anyway. Maybe a better way would be to test whether the S_IF* constants are in a specific range. But then, it is probably not worth the time to investigate that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | xconnect: avoid using getsockname/getpeername on WindowsJohannes Schindelin2017-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantics of said functions is a bit different on Windows than on Linux: it takes a `SOCKET` parameter instead of an `int` parameter, as Windows does not use file descriptors for sockets. The callers of these functions are only used in the daemons anyway, though, and those are not compiled in busybox-w32. Therefore, let's simply skip compiling those functions on Windows (as well as `get_lsa()`, which would now be unused otherwise). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | mingw: accommodate for BusyBox' assumptions about isatty()Johannes Schindelin2017-08-242-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, isatty(fd) determines whether the file descriptor refers to a character device. The thing is: even NUL or a printer is a character device. BusyBox thinks, however, that isatty() only returns non-zero for an interactive terminal. So let's shadow isatty() by a version that answers the question BusyBox wants to have answered. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | bb_basename: handle mixed slashes correctlyJohannes Schindelin2017-08-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | A path like C:/WINDOWS\system32 was handled incorrectly: it found the forward slash, and then never bothered to look whether there was another (back-)slash later on. This fixes e.g. running BusyBox as C:/test\sh.exe Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32: remove implementation of mempcpyRon Yorston2017-08-233-33/+0
| | | | | | | | | | mingw-w64 has its own mempcpy. And even if it didn't upstream BusyBox has one too. So we definitely don't need our own.
* | Merge branch 'busybox' into mergeRon Yorston2017-08-232-6/+7
|\|
| * tar: fix handling of first argument without '-'Ron Yorston2017-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | The following no longer works as expected: $ ./busybox tar xfz test.tgz tar: can't open 'z': No such file or directory Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sendmail: fix segfault if "To: email1,email2" is usedDenys Vlasenko2017-08-221-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | sed: support the -b/--binary optionJohannes Schindelin2017-08-231-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option was introduced in Cygwin's and MSYS2's sed, to allow for keeping Carriage Returns (otherwise, they would be stripped and the output would always be LF-only). Git for Windows' test suite relies on the presence of this option. It was easy enough to implement, too. Conditional compilation added by rmy. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/strptime: fix for negative timezonesJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | I bet this has been fixed in gnulib, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | include/mingw.h: remove unnecessary definition of PRIuMAXRon Yorston2017-08-231-1/+0
| |