When we merely chdir to saved "real" root fd,
exec("proc/self/exe") works for static executables but not
for dynamic ones (they can't find their interpreter).
With this patch, we also *chroot* to real root.
As a bonus, this gives us proper usernames, timezone conversion
etc.
function old new delta
popen_ls 203 259 +56
ftpd_main 2362 2366 +4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
since mtd-utils 1.4.7, the default behaviour of nanddump is skipbad
(commit 2521d4f1b6b9866a9c89f3c11a4f6a3d763ff1d7)
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
since mtd-utils 1.4.7, the omit bad block method has been removed.
(cf commit d8b8f780ec3c916f3990e9227d6bfbb22bf42ef8)
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
In mtd-utils, the bad block options changed in favor of
--bb=[skipbad|padbad|dumpbad] and omitbad has been removed.
This patch add the --bb=skipbad and padbad methods to busybox' nanddump.
padbad is the current default behaviour.
The difference between skipbad and omitbad is this one:
On a 16K block NAND, if the 1st block of mtd0 is bad, we'll have:
nanddump -b -l 16384 /dev/mtd0 | wc -c
0
nanddump --bb=skipbad -l 16384 /dev/mtd0 | wc -c
16384 <- data from 1st good block
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
function old new delta
unlink_main - 45 +45
packed_usage 29667 29686 +19
Signed-off-by: Isaac Dunham <ibid.ag@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This set of patches adds a simple unit-testing framework to Busybox
unit-tests: add some helper macros for unit-test framework implementation
unit-tests: implement the unit-testing framework
unit-tests: add basic documentation on writing the unit test cases
unit-tests: modify the Makefile 'test' target to run unit-tests too
unit-tests: add two example test cases
unit-tests: modify the existing strrstr test code to use the unit-test framework
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The find utility uses a hardcoded value of 32 * 1024 as the limit of
the command-line length when calling 'find -exec ... {} +'. This results
in over 4 times more execve() calls than in coreutils' find.
This patch uses the limit defined in system headers.
Based on the patch by Bartosz Golaszewski <bartekgola@gmail.com>.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Always unlink + reopen, rather than sometimes using ftruncate();
using a single code-path reduces the opportunity for either
mistakes or duplicate code.
Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Forgetting to re-set log_file->size after truncating to zero
discards log-data for the next 1 second following an oversize-induced purge,
when we shouldn't necessarily throw that data away.
Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Closes 627 and 7034.
Commonly seen case is (un)loading of an alias
which matches ata_generic and a more specific ata module.
For example:
modprobe [-r] pci:v00008086d00007010sv00000000sd00000000bc01sc01i80
(ata_generic and pata_acpi)
modprobe [-r] pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a
(ata_generic and pata_via)
function old new delta
process_module 615 728 +113
parse_module 309 395 +86
find_alias 621 653 +32
pathname_matches_modname 78 79 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 232/0) Total: 232 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Before this cahnge, sometimes they were used after the next packet
from another peer was received, because we did updare some peer stats
from high delay packet before dropping it.
function old new delta
recv_and_process_peer_pkt 922 966 +44
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
POSIX.1-2008 removed the usleep function, provide a fallback
implementaion using the recommended nanosleep().
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>