| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
I (slightly) prefer my code to be under "GPLv2 only" license.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
packed_usage 31615 31501 -114
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
packed_usage 31624 31615 -9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
xargs_main 827 787 -40
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
get_address 165 211 +46
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| | |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
According to the man page:
If sig is 0, then no signal is sent, but existence and permission
checks are still performed
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Remove the check for argv being NULL in spawnveq. It shouldn't
ever succeed.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Pass-through mode never worked: it uses fork().
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
|