Compare commits
231
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be7d1b7b17 | ||
|
|
a667a7f020 | ||
|
|
371fe9f71d | ||
|
|
e4b5ccd13b | ||
|
|
b20b3790b4 | ||
|
|
23da5c4b71 | ||
|
|
14e28c18ca | ||
|
|
6c38d0e9da | ||
|
|
08fb86726b | ||
|
|
0829fce079 | ||
|
|
1ad2f5cd9f | ||
|
|
999e290ef6 | ||
|
|
d745852f13 | ||
|
|
a3c5068306 | ||
|
|
05e5d6a381 | ||
|
|
0af28b84e5 | ||
|
|
87c31609f4 | ||
|
|
ba0f94458b | ||
|
|
0a88a7ae3b | ||
|
|
2eea3494f1 | ||
|
|
45d471d435 | ||
|
|
38335df9e9 | ||
|
|
49340d93ed | ||
|
|
fb08d43d44 | ||
|
|
eba9b33b45 | ||
|
|
9f262698cc | ||
|
|
a6ce017a8a | ||
|
|
41b47398f5 | ||
|
|
2075553a1b | ||
|
|
5a68a246e7 | ||
|
|
fd47f05676 | ||
|
|
681e4f5d92 | ||
|
|
e1a6874106 | ||
|
|
01f2b5976d | ||
|
|
c5a1be25ba | ||
|
|
f873c63085 | ||
|
|
758b21402a | ||
|
|
2639f3bc72 | ||
|
|
a97a2f1280 | ||
|
|
5dc9ece3b9 | ||
|
|
1cac258521 | ||
|
|
01e80ff9eb | ||
|
|
789ccac7d9 | ||
|
|
5e0e54827f | ||
|
|
28f4126093 | ||
|
|
a63b60bdd6 | ||
|
|
59cf2c23ae | ||
|
|
58ca629fd2 | ||
|
|
2de67a62e8 | ||
|
|
389c0458da | ||
|
|
d17c0a348f | ||
|
|
da8d1d84fd | ||
|
|
73f28134fc | ||
|
|
0c71497e65 | ||
|
|
e265c8d4c0 | ||
|
|
5fa39d48d5 | ||
|
|
92ab29fcf0 | ||
|
|
6d22c9abc2 | ||
|
|
791b222dd5 | ||
|
|
2cc9d436e8 | ||
|
|
ed4a24dfd1 | ||
|
|
8f0845cad7 | ||
|
|
c484846c44 | ||
|
|
a6a102ec4c | ||
|
|
cf809e2f2d | ||
|
|
ab755f4925 | ||
|
|
d70256a5c7 | ||
|
|
9fc5933b10 | ||
|
|
69d33db445 | ||
|
|
5353df91cb | ||
|
|
a9047e0980 | ||
|
|
ae351311da | ||
|
|
5e0411a7fb | ||
|
|
6ce1dc2e91 | ||
|
|
e41e481fd5 | ||
|
|
07a95cfcab | ||
|
|
e5692e2342 | ||
|
|
cc9543fed1 | ||
|
|
045924ed7d | ||
|
|
38f769ab4e | ||
|
|
6a0ba67382 | ||
|
|
800207b90a | ||
|
|
e619a25a55 | ||
|
|
5d8f8570c0 | ||
|
|
c1c267fd36 | ||
|
|
019dd31150 | ||
|
|
db0e886735 | ||
|
|
a165098922 | ||
|
|
79b90cbece | ||
|
|
10cce8ae35 | ||
|
|
7701b526a7 | ||
|
|
8309c9159f | ||
|
|
b61fd8ec5a | ||
|
|
2d06c83b87 | ||
|
|
c72c5552ed | ||
|
|
182e5a4d00 | ||
|
|
96769486e2 | ||
|
|
d0441222db | ||
|
|
2ca9c45953 | ||
|
|
822590f5e2 | ||
|
|
19a74a54de | ||
|
|
6221832bc1 | ||
|
|
d6f98f214b | ||
|
|
550696d492 | ||
|
|
e127985839 | ||
|
|
f8263528cd | ||
|
|
38f423cc9c | ||
|
|
ea6dcbe283 | ||
|
|
22cb0d573a | ||
|
|
648f506949 | ||
|
|
61a4959251 | ||
|
|
5f56a03882 | ||
|
|
3829d8b675 | ||
|
|
2ff01bb699 | ||
|
|
66139330fc | ||
|
|
3df885abe3 | ||
|
|
5febdb1223 | ||
|
|
46dccd2ec0 | ||
|
|
a02450ff0b | ||
|
|
8acbf31708 | ||
|
|
373f64eef3 | ||
|
|
02378ce20c | ||
|
|
c1d7507a4d | ||
|
|
8ccb3f7b13 | ||
|
|
a4f30f3c70 | ||
|
|
d417193cf3 | ||
|
|
bab8828b0d | ||
|
|
8f0e4c42c6 | ||
|
|
4bd70463c7 | ||
|
|
2ca39ffd44 | ||
|
|
113685fbcd | ||
|
|
f4789164e0 | ||
|
|
5f84c56336 | ||
|
|
0256e00a9d | ||
|
|
fe0b798548 | ||
|
|
721bf6eaf4 | ||
|
|
4d7339204f | ||
|
|
05e60007d4 | ||
|
|
b76b420b5d | ||
|
|
9790eb73c8 | ||
|
|
21dce1c3c3 | ||
|
|
5c8a9dfd97 | ||
|
|
528808bcd2 | ||
|
|
84ff1825dd | ||
|
|
9225f9684f | ||
|
|
6d9427420b | ||
|
|
5dcc443dba | ||
|
|
d7814f5727 | ||
|
|
283cba78f2 | ||
|
|
34751d8bf9 | ||
|
|
8fab211141 | ||
|
|
de851bc9b2 | ||
|
|
25a10ffe1f | ||
|
|
60d4d55b87 | ||
|
|
3c6f6382ee | ||
|
|
aa4d303a31 | ||
|
|
0c3270f7e5 | ||
|
|
6882a933cf | ||
|
|
ce4cfc33ca | ||
|
|
e2287f99fe | ||
|
|
64bdd7566c | ||
|
|
2bda790fd1 | ||
|
|
b5be8da350 | ||
|
|
6824298ab4 | ||
|
|
3e83699ce2 | ||
|
|
c5682813ab | ||
|
|
2f663a6f7d | ||
|
|
dc84002a82 | ||
|
|
62775ec4b3 | ||
|
|
3a7f00eadc | ||
|
|
465f05a420 | ||
|
|
3c8e540eb7 | ||
|
|
40fa8eb998 | ||
|
|
07f8b6feac | ||
|
|
c6058d221a | ||
|
|
382e163497 | ||
|
|
7ddd233c80 | ||
|
|
d2b81b3dc2 | ||
|
|
2ffd8986e2 | ||
|
|
acae889dd9 | ||
|
|
90b607d79a | ||
|
|
8b72877bab | ||
|
|
7c1f975cdd | ||
|
|
f7065aa9ae | ||
|
|
8696f5d380 | ||
|
|
238dab322a | ||
|
|
853cfe927f | ||
|
|
550e6d8fbd | ||
|
|
478b5ac2bc | ||
|
|
cb57abb46f | ||
|
|
200a9669fb | ||
|
|
85e4805ae9 | ||
|
|
7362d29794 | ||
|
|
611729eff3 | ||
|
|
9bc2b6e884 | ||
|
|
a26711a2d1 | ||
|
|
05f2bedaeb | ||
|
|
ff8fde111e | ||
|
|
46e92e1e56 | ||
|
|
a33d19eba8 | ||
|
|
94780e3e8e | ||
|
|
7ababc3e3c | ||
|
|
2860b2530e | ||
|
|
6748e6494c | ||
|
|
fd5fb2d2b5 | ||
|
|
1409432d07 | ||
|
|
00fc136843 | ||
|
|
262a845477 | ||
|
|
098cd7ece4 | ||
|
|
af5277f883 | ||
|
|
470fa7b364 | ||
|
|
f2e659415a | ||
|
|
a59e5a7d08 | ||
|
|
bd76b75f72 | ||
|
|
3253d7fe00 | ||
|
|
d8a3360380 | ||
|
|
2d4a3d9e6c | ||
|
|
029740a3e4 | ||
|
|
75197998c2 | ||
|
|
669c40ed8e | ||
|
|
93ae7464e6 | ||
|
|
1fdb33bd07 | ||
|
|
6101b6d3ea | ||
|
|
93e0898c66 | ||
|
|
c2739e11de | ||
|
|
1040f78176 | ||
|
|
479bd7af0d | ||
|
|
c344ca6c7f | ||
|
|
85acf71d25 | ||
|
|
ca96022d6e | ||
|
|
b1884deb51 |
No files matched your search
@@ -108,6 +108,17 @@ config LFS
|
||||
programs that can benefit from large file support include dd, gzip,
|
||||
cp, mount, tar.
|
||||
|
||||
config TIME64
|
||||
bool "Support 64bit wide time types"
|
||||
default y
|
||||
depends on LFS
|
||||
help
|
||||
Make times later than 2038 representable for several libc syscalls
|
||||
(stat, clk_gettime etc.). Note this switch is specific to glibc
|
||||
and has no effect on platforms that already use 64bit wide time types
|
||||
(i.e. all 64bit archs and some selected 32bit archs (currently riscv
|
||||
and x32)).
|
||||
|
||||
config PAM
|
||||
bool "Support PAM (Pluggable Authentication Modules)"
|
||||
default n
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 36
|
||||
PATCHLEVEL = 37
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
@@ -967,6 +967,7 @@ endif # CONFIG_MODULES
|
||||
# Directories & files removed with 'make clean'
|
||||
CLEAN_DIRS += $(MODVERDIR) _install 0_lib
|
||||
CLEAN_FILES += busybox busybox_unstripped* busybox.links \
|
||||
busybox*.suid busybox*.nosuid \
|
||||
System.map .kernelrelease \
|
||||
.tmp_kallsyms* .tmp_version .tmp_busybox* .tmp_System.map
|
||||
|
||||
|
||||
+4
-3
@@ -15,6 +15,7 @@ CPPFLAGS += \
|
||||
-include include/autoconf.h \
|
||||
-D_GNU_SOURCE -DNDEBUG \
|
||||
$(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
|
||||
$(if $(CONFIG_TIME64),-D_TIME_BITS=64) \
|
||||
-DBB_VER=$(squote)$(quote)$(BB_VER)$(quote)$(squote)
|
||||
|
||||
CFLAGS += $(call cc-option,-Wall,)
|
||||
@@ -47,7 +48,7 @@ endif
|
||||
# gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action()
|
||||
CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition)
|
||||
|
||||
ifneq ($(CC),clang)
|
||||
ifneq ($(lastword $(subst -, ,$(CC))),clang)
|
||||
# "clang-9: warning: optimization flag '-finline-limit=0' is not supported
|
||||
CFLAGS += $(call cc-option,-finline-limit=0,)
|
||||
endif
|
||||
@@ -65,7 +66,7 @@ CFLAGS += $(call cc-option,-static-libgcc,)
|
||||
endif
|
||||
|
||||
CFLAGS += $(call cc-option,-falign-functions=1,)
|
||||
ifneq ($(CC),clang)
|
||||
ifneq ($(lastword $(subst -, ,$(CC))),clang)
|
||||
# "clang-9: warning: optimization flag '-falign-jumps=1' is not supported" (and same for other two)
|
||||
CFLAGS += $(call cc-option,-falign-jumps=1 -falign-labels=1 -falign-loops=1,)
|
||||
endif
|
||||
@@ -78,7 +79,7 @@ CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
|
||||
CFLAGS += $(call cc-option,-fno-builtin-printf,)
|
||||
|
||||
# clang-9 does not like "str" + N and "if (CONFIG_ITEM && cond)" constructs
|
||||
ifeq ($(CC),clang)
|
||||
ifeq ($(lastword $(subst -, ,$(CC))),clang)
|
||||
CFLAGS += $(call cc-option,-Wno-string-plus-int -Wno-constant-logical-operand)
|
||||
endif
|
||||
|
||||
|
||||
@@ -222,8 +222,6 @@ Minor stuff:
|
||||
---
|
||||
unify progress_meter. wget, flash_eraseall, pipe_progress, fbsplash, setfiles.
|
||||
---
|
||||
support start-stop-daemon -d <chdir-path>
|
||||
---
|
||||
|
||||
(TODO list after discussion 11.05.2009)
|
||||
|
||||
|
||||
@@ -20,5 +20,5 @@ int main(int argc, char **argv)
|
||||
void bb_show_usage(void)
|
||||
{
|
||||
fputs_stdout(APPLET_full_usage "\n");
|
||||
exit(EXIT_FAILURE);
|
||||
exit_FAILURE();
|
||||
}
|
||||
+4
-4
@@ -415,7 +415,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
|
||||
//usage: "Decompress to stdout"
|
||||
|
||||
//config:config BUNZIP2
|
||||
//config: bool "bunzip2 (8.7 kb)"
|
||||
//config: bool "bunzip2 (9.1 kb)"
|
||||
//config: default y
|
||||
//config: select FEATURE_BZIP2_DECOMPRESS
|
||||
//config: help
|
||||
@@ -429,7 +429,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
|
||||
//config: should probably say N here.
|
||||
//config:
|
||||
//config:config BZCAT
|
||||
//config: bool "bzcat (8.7 kb)"
|
||||
//config: bool "bzcat (9 kb)"
|
||||
//config: default y
|
||||
//config: select FEATURE_BZIP2_DECOMPRESS
|
||||
//config: help
|
||||
@@ -485,7 +485,7 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
|
||||
//usage: "Decompress to stdout"
|
||||
|
||||
//config:config UNLZMA
|
||||
//config: bool "unlzma (7.5 kb)"
|
||||
//config: bool "unlzma (7.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: unlzma is a compression utility using the Lempel-Ziv-Markov chain
|
||||
@@ -494,7 +494,7 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
|
||||
//config: compressors.
|
||||
//config:
|
||||
//config:config LZCAT
|
||||
//config: bool "lzcat (7.5 kb)"
|
||||
//config: bool "lzcat (7.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Alias to "unlzma -c".
|
||||
|
||||
+1
-2
@@ -62,7 +62,7 @@
|
||||
//usage: " [-ti"IF_FEATURE_CPIO_O("o")"]" IF_FEATURE_CPIO_P(" [-p DIR]")
|
||||
//usage: " [EXTR_FILE]..."
|
||||
//usage:#define cpio_full_usage "\n\n"
|
||||
//usage: "Extract (-i) or list (-t) files from a cpio archive"
|
||||
//usage: "Extract (-i) or list (-t) files from a cpio archive on stdin"
|
||||
//usage: IF_FEATURE_CPIO_O(", or"
|
||||
//usage: "\ntake file list from stdin and create an archive (-o)"
|
||||
//usage: IF_FEATURE_CPIO_P(" or copy files (-p)")
|
||||
@@ -504,7 +504,6 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
goto dump;
|
||||
}
|
||||
/* parent */
|
||||
USE_FOR_NOMMU(argv[-optind][0] &= 0x7f); /* undo fork_or_rexec() damage */
|
||||
xchdir(*argv++);
|
||||
close(pp.wr);
|
||||
xmove_fd(pp.rd, STDIN_FILENO);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DPKG_DEB
|
||||
//config: bool "dpkg-deb (30 kb)"
|
||||
//config: bool "dpkg-deb (29 kb)"
|
||||
//config: default y
|
||||
//config: select FEATURE_SEAMLESS_GZ
|
||||
//config: help
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
"Minimalized" for busybox by Alain Knaff
|
||||
*/
|
||||
//config:config LZOP
|
||||
//config: bool "lzop (12 kb)"
|
||||
//config: bool "lzop (13 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Lzop compression/decompresion.
|
||||
|
||||
+1
-1
@@ -621,7 +621,7 @@ static void NOINLINE vfork_compressor(int tar_fd, const char *gzip)
|
||||
execlp(gzip, gzip, "-f", (char *)0);
|
||||
|
||||
vfork_exec_errno = errno;
|
||||
_exit(EXIT_FAILURE);
|
||||
_exit_FAILURE();
|
||||
}
|
||||
|
||||
/* parent */
|
||||
|
||||
+19
-3
@@ -56,7 +56,7 @@
|
||||
//kbuild:lib-$(CONFIG_UNZIP) += unzip.o
|
||||
|
||||
//usage:#define unzip_trivial_usage
|
||||
//usage: "[-lnojpq] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]"
|
||||
//usage: "[-lnojpqK] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]"
|
||||
//usage:#define unzip_full_usage "\n\n"
|
||||
//usage: "Extract FILEs from ZIP archive\n"
|
||||
//usage: "\n -l List contents (with -q for short form)"
|
||||
@@ -66,6 +66,7 @@
|
||||
//usage: "\n -p Write to stdout"
|
||||
//usage: "\n -t Test"
|
||||
//usage: "\n -q Quiet"
|
||||
//usage: "\n -K Do not clear SUID bit"
|
||||
//usage: "\n -x FILE Exclude FILEs"
|
||||
//usage: "\n -d DIR Extract into DIR"
|
||||
|
||||
@@ -494,6 +495,7 @@ int unzip_main(int argc, char **argv)
|
||||
OPT_l = (1 << 0),
|
||||
OPT_x = (1 << 1),
|
||||
OPT_j = (1 << 2),
|
||||
OPT_K = (1 << 3),
|
||||
};
|
||||
unsigned opts;
|
||||
smallint quiet = 0;
|
||||
@@ -557,9 +559,14 @@ int unzip_main(int argc, char **argv)
|
||||
* 204372 1 file
|
||||
*/
|
||||
|
||||
//TODO: accept and ignore these?
|
||||
// -a convert to text files with 't' label, -aa: all files
|
||||
// -b do not convert to text - bbox: we don't convert anything
|
||||
// -D skip restoration of timestamps for extracted items - bbox: we don't restore these (yet?)
|
||||
// -X restore user:group ownership
|
||||
opts = 0;
|
||||
/* '-' makes getopt return 1 for non-options */
|
||||
while ((i = getopt(argc, argv, "-d:lnotpqxjv")) != -1) {
|
||||
while ((i = getopt(argc, argv, "-d:lnotpqxjvK")) != -1) {
|
||||
switch (i) {
|
||||
case 'd': /* Extract to base directory */
|
||||
base_dir = optarg;
|
||||
@@ -581,6 +588,7 @@ int unzip_main(int argc, char **argv)
|
||||
xmove_fd(xopen("/dev/null", O_WRONLY), STDOUT_FILENO);
|
||||
/*fallthrough*/
|
||||
|
||||
// NB: -c extract files to stdout/screen (unlike -p, also prints .zip and file names to stdout)
|
||||
case 'p': /* Extract files to stdout */
|
||||
dst_fd = STDOUT_FILENO;
|
||||
/*fallthrough*/
|
||||
@@ -602,6 +610,10 @@ int unzip_main(int argc, char **argv)
|
||||
opts |= OPT_j;
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
opts |= OPT_K;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!src_fn) {
|
||||
/* The zip file */
|
||||
@@ -819,7 +831,10 @@ int unzip_main(int argc, char **argv)
|
||||
# endif
|
||||
if ((cdf.fmt.version_made_by >> 8) == 3) {
|
||||
/* This archive is created on Unix */
|
||||
dir_mode = file_mode = (cdf.fmt.external_attributes >> 16);
|
||||
file_mode = (cdf.fmt.external_attributes >> 16);
|
||||
if (!(opts & OPT_K))
|
||||
file_mode &= ~(mode_t)(S_ISUID | S_ISGID);
|
||||
dir_mode = file_mode;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -844,6 +859,7 @@ int unzip_main(int argc, char **argv)
|
||||
unzip_skip(zip.fmt.extra_len);
|
||||
|
||||
/* Guard against "/abspath", "/../" and similar attacks */
|
||||
// NB: UnZip 6.00 has option -: to disable this
|
||||
overlapping_strcpy(dst_fn, strip_unsafe_prefix(dst_fn));
|
||||
|
||||
/* Filter zip entries */
|
||||
|
||||
@@ -703,6 +703,7 @@ CONFIG_FEATURE_INETD_RPC=y
|
||||
CONFIG_IP=y
|
||||
CONFIG_FEATURE_IP_ADDRESS=y
|
||||
CONFIG_FEATURE_IP_LINK=y
|
||||
CONFIG_FEATURE_IP_LINK_CAN=y
|
||||
CONFIG_FEATURE_IP_ROUTE=y
|
||||
CONFIG_FEATURE_IP_TUNNEL=y
|
||||
CONFIG_FEATURE_IP_RULE=y
|
||||
|
||||
+605
-367
File diff suppressed because it is too large.
Load diff
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CHVT
|
||||
//config: bool "chvt (2 kb)"
|
||||
//config: bool "chvt (2.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program is used to change to another terminal.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CLEAR
|
||||
//config: bool "clear (tiny)"
|
||||
//config: bool "clear (371 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program clears the terminal screen.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DEALLOCVT
|
||||
//config: bool "deallocvt (1.9 kb)"
|
||||
//config: bool "deallocvt (2.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program deallocates unused virtual consoles.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DUMPKMAP
|
||||
//config: bool "dumpkmap (1.6 kb)"
|
||||
//config: bool "dumpkmap (1.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program dumps the kernel's keyboard translation table to
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config FGCONSOLE
|
||||
//config: bool "fgconsole (1.5 kb)"
|
||||
//config: bool "fgconsole (1.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program prints active (foreground) console number.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config KBD_MODE
|
||||
//config: bool "kbd_mode (4.1 kb)"
|
||||
//config: bool "kbd_mode (4.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program reports and sets keyboard mode.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config LOADFONT
|
||||
//config: bool "loadfont (5.2 kb)"
|
||||
//config: bool "loadfont (5.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program loads a console font from standard input.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config LOADKMAP
|
||||
//config: bool "loadkmap (1.8 kb)"
|
||||
//config: bool "loadkmap (2.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program loads a keyboard translation table from
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config OPENVT
|
||||
//config: bool "openvt (7.2 kb)"
|
||||
//config: bool "openvt (7.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program is used to start a command on an unused
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config RESET
|
||||
//config: bool "reset (345 bytes)"
|
||||
//config: bool "reset (676 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program is used to reset the terminal screen, if it
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config RESIZE
|
||||
//config: bool "resize (903 bytes)"
|
||||
//config: bool "resize (1.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program is used to (re)set the width and height of your current
|
||||
@@ -45,7 +45,7 @@ static void
|
||||
onintr(int sig UNUSED_PARAM)
|
||||
{
|
||||
tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
|
||||
_exit(EXIT_FAILURE);
|
||||
_exit_FAILURE();
|
||||
}
|
||||
|
||||
int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SETCONSOLE
|
||||
//config: bool "setconsole (3.6 kb)"
|
||||
//config: bool "setconsole (3.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Redirect writes to /dev/console to another device,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SETKEYCODES
|
||||
//config: bool "setkeycodes (2.1 kb)"
|
||||
//config: bool "setkeycodes (2.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program loads entries into the kernel's scancode-to-keycode
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SETLOGCONS
|
||||
//config: bool "setlogcons (1.8 kb)"
|
||||
//config: bool "setlogcons (2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program redirects the output console of kernel messages.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SHOWKEY
|
||||
//config: bool "showkey (4.7 kb)"
|
||||
//config: bool "showkey (4.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Shows keys pressed.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* 3) Save some space by using strcmp(). Calling strncmp() here was silly.
|
||||
*/
|
||||
//config:config BASENAME
|
||||
//config: bool "basename (438 bytes)"
|
||||
//config: bool "basename (3.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: basename is used to strip the directory and suffix from filenames,
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CAT
|
||||
//config: bool "cat (5.6 kb)"
|
||||
//config: bool "cat (5.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: cat is used to concatenate files and print them to the standard
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CHROOT
|
||||
//config: bool "chroot (3.7 kb)"
|
||||
//config: bool "chroot (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: chroot is used to change the root directory and run a command.
|
||||
|
||||
+3
-3
@@ -7,11 +7,11 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CKSUM
|
||||
//config: bool "cksum (4.1 kb)"
|
||||
//config: bool "cksum (4.3 kb)"
|
||||
//config: default y
|
||||
//config:
|
||||
//config:config CRC32
|
||||
//config: bool "crc32 (4.1 kb)"
|
||||
//config: bool "crc32 (4.2 kb)"
|
||||
//config: default y
|
||||
|
||||
// APPLET_NOEXEC:name main location suid_type help
|
||||
@@ -39,7 +39,7 @@ int cksum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cksum_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
uint32_t *crc32_table = crc32_filltable(NULL, IS_CKSUM);
|
||||
int exit_code = EXIT_SUCCESS;
|
||||
exitcode_t exit_code = EXIT_SUCCESS;
|
||||
|
||||
#if ENABLE_DESKTOP
|
||||
getopt32(argv, ""); /* cksum coreutils 6.9 compat */
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config COMM
|
||||
//config: bool "comm (4.2 kb)"
|
||||
//config: bool "comm (4.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: comm is used to compare two files line by line and return
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config CUT
|
||||
//config: bool "cut (5.8 kb)"
|
||||
//config: bool "cut (6.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: cut is used to print selected parts of lines from
|
||||
@@ -311,7 +311,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
|
||||
}
|
||||
|
||||
{
|
||||
int retval = EXIT_SUCCESS;
|
||||
exitcode_t retval = EXIT_SUCCESS;
|
||||
|
||||
if (!*argv)
|
||||
*--argv = (char *)"-";
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
much as possible, missed out a lot of bounds checking */
|
||||
|
||||
//config:config DATE
|
||||
//config: bool "date (7 kb)"
|
||||
//config: bool "date (7.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: date is used to set the system date or display the
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DD
|
||||
//config: bool "dd (7.5 kb)"
|
||||
//config: bool "dd (8.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: dd copies a file (from standard input to standard output,
|
||||
@@ -375,7 +375,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
|
||||
OP_oflag_direct,
|
||||
#endif
|
||||
};
|
||||
smallint exitcode = EXIT_FAILURE;
|
||||
exitcode_t exitcode = EXIT_FAILURE;
|
||||
int i;
|
||||
size_t ibs = 512;
|
||||
char *ibuf;
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
* Implement -P and -B; better coreutils compat; cleanup
|
||||
*/
|
||||
//config:config DF
|
||||
//config: bool "df (6.8 kb)"
|
||||
//config: bool "df (7.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: df reports the amount of disk space used and available
|
||||
@@ -113,7 +113,7 @@ int df_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int df_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
unsigned long df_disp_hr = 1024;
|
||||
int status = EXIT_SUCCESS;
|
||||
exitcode_t status = EXIT_SUCCESS;
|
||||
unsigned opt;
|
||||
FILE *mount_table;
|
||||
struct mntent *mount_entry;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DIRNAME
|
||||
//config: bool "dirname (329 bytes)"
|
||||
//config: bool "dirname (611 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: dirname is used to strip a non-directory suffix from
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config DOS2UNIX
|
||||
//config: bool "dos2unix (5.2 kb)"
|
||||
//config: bool "dos2unix (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: dos2unix is used to convert a text file from DOS format to
|
||||
//config: UNIX format, and vice versa.
|
||||
//config:
|
||||
//config:config UNIX2DOS
|
||||
//config: bool "unix2dos (5.2 kb)"
|
||||
//config: bool "unix2dos (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: unix2dos is used to convert a text file from UNIX format to
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* 4) Fixed busybox bug #1284 involving long overflow with human_readable.
|
||||
*/
|
||||
//config:config DU
|
||||
//config: bool "du (6.3 kb)"
|
||||
//config: bool "du (6.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: du is used to report the amount of disk space used
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* The previous version did not allow 4-digit octals.
|
||||
*/
|
||||
//config:config ECHO
|
||||
//config: bool "echo (1.8 kb)"
|
||||
//config: bool "echo (2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: echo prints a specified string to stdout.
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
* - use xfunc_error_retval
|
||||
*/
|
||||
//config:config ENV
|
||||
//config: bool "env (4 kb)"
|
||||
//config: bool "env (4.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: env is used to set an environment variable and run
|
||||
|
||||
+3
-3
@@ -21,13 +21,13 @@
|
||||
* Caveat: this versions of expand and unexpand don't accept tab lists.
|
||||
*/
|
||||
//config:config EXPAND
|
||||
//config: bool "expand (5.1 kb)"
|
||||
//config: bool "expand (5.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: By default, convert all tabs to spaces.
|
||||
//config:
|
||||
//config:config UNEXPAND
|
||||
//config: bool "unexpand (5.3 kb)"
|
||||
//config: bool "unexpand (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: By default, convert only leading sequences of blanks to tabs.
|
||||
@@ -192,7 +192,7 @@ int expand_main(int argc UNUSED_PARAM, char **argv)
|
||||
FILE *file;
|
||||
unsigned tab_size;
|
||||
unsigned opt;
|
||||
int exit_status = EXIT_SUCCESS;
|
||||
exitcode_t exit_status = EXIT_SUCCESS;
|
||||
|
||||
init_unicode();
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
* provided they all associate ((x op x) op x).
|
||||
*/
|
||||
//config:config EXPR
|
||||
//config: bool "expr (6.6 kb)"
|
||||
//config: bool "expr (6.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: expr is used to calculate numbers and print the result
|
||||
|
||||
+36
-37
@@ -4,7 +4,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config FACTOR
|
||||
//config: bool "factor (2.7 kb)"
|
||||
//config: bool "factor (3.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: factor factorizes integers
|
||||
@@ -48,38 +48,40 @@ typedef unsigned long half_t;
|
||||
* Larger wheels improve sieving only slightly, but quickly grow in size
|
||||
* (adding just one prime, 13, results in 5766 element sieve).
|
||||
*/
|
||||
#define R(a,b,c,d,e,f,g,h,i,j,A,B,C,D,E,F,G,H,I,J) \
|
||||
(((uint64_t)(a<<0) | (b<<3) | (c<<6) | (d<<9) | (e<<12) | (f<<15) | (g<<18) | (h<<21) | (i<<24) | (j<<27)) << 1) | \
|
||||
(((uint64_t)(A<<0) | (B<<3) | (C<<6) | (D<<9) | (E<<12) | (F<<15) | (G<<18) | (H<<21) | (I<<24) | (J<<27)) << 31)
|
||||
#define P(a,b,c,d,e,f,g,h,i,j,A,B,C,D,E,F,G,H,I,J) \
|
||||
#define R(a,b,c,d,e,f,g,h,i,j,A,B,C,D,E,F,G,H,I,J,x) \
|
||||
(((uint64_t)(a<<0) | (b<<3) | (c<<6) | (d<<9) | (e<<12) | (f<<15) | (g<<18) | (h<<21) | (i<<24) | (j<<27)) << 1) | \
|
||||
(((uint64_t)(A<<0) | (B<<3) | (C<<6) | (D<<9) | (E<<12) | (F<<15) | (G<<18) | (H<<21) | (I<<24) | (J<<27)) << 31) | \
|
||||
((uint64_t)x << 61)
|
||||
#define P(a,b,c,d,e,f,g,h,i,j,A,B,C,D,E,F,G,H,I,J,x) \
|
||||
R( (a/2),(b/2),(c/2),(d/2),(e/2),(f/2),(g/2),(h/2),(i/2),(j/2), \
|
||||
(A/2),(B/2),(C/2),(D/2),(E/2),(F/2),(G/2),(H/2),(I/2),(J/2) )
|
||||
(A/2),(B/2),(C/2),(D/2),(E/2),(F/2),(G/2),(H/2),(I/2),(J/2), \
|
||||
(x/2) \
|
||||
)
|
||||
static const uint64_t packed_wheel[] = {
|
||||
/*1, 2, 2, 4, 2,*/
|
||||
P( 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4), //01
|
||||
P( 2, 4, 2, 4,14, 4, 6, 2,10, 2, 6, 6, 4, 2, 4, 6, 2,10, 2, 4), //02
|
||||
P( 2,12,10, 2, 4, 2, 4, 6, 2, 6, 4, 6, 6, 6, 2, 6, 4, 2, 6, 4), //03
|
||||
P( 6, 8, 4, 2, 4, 6, 8, 6,10, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2), //04
|
||||
P( 6, 4, 2, 6,10, 2,10, 2, 4, 2, 4, 6, 8, 4, 2, 4,12, 2, 6, 4), //05
|
||||
P( 2, 6, 4, 6,12, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6,10, 2), //06
|
||||
P( 4, 6, 2, 6, 4, 2, 4, 2,10, 2,10, 2, 4, 6, 6, 2, 6, 6, 4, 6), //07
|
||||
P( 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 6, 4, 8, 6, 4, 6, 2, 4, 6), //08
|
||||
P( 8, 6, 4, 2,10, 2, 6, 4, 2, 4, 2,10, 2,10, 2, 4, 2, 4, 8, 6), //09
|
||||
P( 4, 2, 4, 6, 6, 2, 6, 4, 8, 4, 6, 8, 4, 2, 4, 2, 4, 8, 6, 4), //10
|
||||
P( 6, 6, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2,10, 2,10, 2), //11
|
||||
P( 6, 4, 6, 2, 6, 4, 2, 4, 6, 6, 8, 4, 2, 6,10, 8, 4, 2, 4, 2), //12
|
||||
P( 4, 8,10, 6, 2, 4, 8, 6, 6, 4, 2, 4, 6, 2, 6, 4, 6, 2,10, 2), //13
|
||||
P(10, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 6, 6, 4, 6, 8), //14
|
||||
P( 4, 2, 4, 2, 4, 8, 6, 4, 8, 4, 6, 2, 6, 6, 4, 2, 4, 6, 8, 4), //15
|
||||
P( 2, 4, 2,10, 2,10, 2, 4, 2, 4, 6, 2,10, 2, 4, 6, 8, 6, 4, 2), //16
|
||||
P( 6, 4, 6, 8, 4, 6, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6, 4, 6), //17
|
||||
P( 6, 2, 6, 6, 4, 2,10, 2,10, 2, 4, 2, 4, 6, 2, 6, 4, 2,10, 6), //18
|
||||
P( 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2,12, 6, 4, 6, 2, 4, 6, 2), //19
|
||||
P(12, 4, 2, 4, 8, 6, 4, 2, 4, 2,10, 2,10, 6, 2, 4, 6, 2, 6, 4), //20
|
||||
P( 2, 4, 6, 6, 2, 6, 4, 2,10, 6, 8, 6, 4, 2, 4, 8, 6, 4, 6, 2), //21
|
||||
P( 4, 6, 2, 6, 6, 6, 4, 6, 2, 6, 4, 2, 4, 2,10,12, 2, 4, 2,10), //22
|
||||
P( 2, 6, 4, 2, 4, 6, 6, 2,10, 2, 6, 4,14, 4, 2, 4, 2, 4, 8, 6), //23
|
||||
P( 4, 6, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4,12, 2,12), //24
|
||||
/* 1, 2, */
|
||||
P( 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6),
|
||||
P( 8, 4, 2, 4, 2, 4,14, 4, 6, 2,10, 2, 6, 6, 4, 2, 4, 6, 2,10, 2),
|
||||
P( 4, 2,12,10, 2, 4, 2, 4, 6, 2, 6, 4, 6, 6, 6, 2, 6, 4, 2, 6, 4),
|
||||
P( 6, 8, 4, 2, 4, 6, 8, 6,10, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6),
|
||||
P( 4, 2, 6,10, 2,10, 2, 4, 2, 4, 6, 8, 4, 2, 4,12, 2, 6, 4, 2, 6),
|
||||
P( 4, 6,12, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6,10, 2, 4, 6, 2),
|
||||
P( 6, 4, 2, 4, 2,10, 2,10, 2, 4, 6, 6, 2, 6, 6, 4, 6, 6, 2, 6, 4),
|
||||
P( 2, 6, 4, 6, 8, 4, 2, 6, 4, 8, 6, 4, 6, 2, 4, 6, 8, 6, 4, 2,10),
|
||||
P( 2, 6, 4, 2, 4, 2,10, 2,10, 2, 4, 2, 4, 8, 6, 4, 2, 4, 6, 6, 2),
|
||||
P( 6, 4, 8, 4, 6, 8, 4, 2, 4, 2, 4, 8, 6, 4, 6, 6, 6, 2, 6, 6, 4),
|
||||
P( 2, 4, 6, 2, 6, 4, 2, 4, 2,10, 2,10, 2, 6, 4, 6, 2, 6, 4, 2, 4),
|
||||
P( 6, 6, 8, 4, 2, 6,10, 8, 4, 2, 4, 2, 4, 8,10, 6, 2, 4, 8, 6, 6),
|
||||
P( 4, 2, 4, 6, 2, 6, 4, 6, 2,10, 2,10, 2, 4, 2, 4, 6, 2, 6, 4, 2),
|
||||
P( 4, 6, 6, 2, 6, 6, 6, 4, 6, 8, 4, 2, 4, 2, 4, 8, 6, 4, 8, 4, 6),
|
||||
P( 2, 6, 6, 4, 2, 4, 6, 8, 4, 2, 4, 2,10, 2,10, 2, 4, 2, 4, 6, 2),
|
||||
P(10, 2, 4, 6, 8, 6, 4, 2, 6, 4, 6, 8, 4, 6, 2, 4, 8, 6, 4, 6, 2),
|
||||
P( 4, 6, 2, 6, 6, 4, 6, 6, 2, 6, 6, 4, 2,10, 2,10, 2, 4, 2, 4, 6),
|
||||
P( 2, 6, 4, 2,10, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2,12, 6, 4),
|
||||
P( 6, 2, 4, 6, 2,12, 4, 2, 4, 8, 6, 4, 2, 4, 2,10, 2,10, 6, 2, 4),
|
||||
P( 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2,10, 6, 8, 6, 4, 2, 4, 8, 6),
|
||||
P( 4, 6, 2, 4, 6, 2, 6, 6, 6, 4, 6, 2, 6, 4, 2, 4, 2,10,12, 2, 4),
|
||||
P( 2,10, 2, 6, 4, 2, 4, 6, 6, 2,10, 2, 6, 4,14, 4, 2, 4, 2, 4, 8),
|
||||
P( 6, 4, 6, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4,12, 2,12),
|
||||
};
|
||||
#undef P
|
||||
#undef R
|
||||
@@ -93,8 +95,8 @@ static const uint64_t packed_wheel[] = {
|
||||
* function old new delta
|
||||
* wheel_tab - 485 +485
|
||||
* 3-bit-packed insanity:
|
||||
* packed_wheel - 192 +192
|
||||
* factor_main 108 171 +63
|
||||
* packed_wheel - 184 +184
|
||||
* factor_main 108 163 +55
|
||||
*/
|
||||
static void unpack_wheel(void)
|
||||
{
|
||||
@@ -104,10 +106,7 @@ static void unpack_wheel(void)
|
||||
setup_common_bufsiz();
|
||||
wheel_tab[0] = 1;
|
||||
wheel_tab[1] = 2;
|
||||
wheel_tab[2] = 2;
|
||||
wheel_tab[3] = 4;
|
||||
wheel_tab[4] = 2;
|
||||
p = &wheel_tab[5];
|
||||
p = &wheel_tab[2];
|
||||
for (i = 0; i < ARRAY_SIZE(packed_wheel); i++) {
|
||||
uint64_t v = packed_wheel[i];
|
||||
while ((v & 0xe) != 0) {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config FALSE
|
||||
//config: bool "false (tiny)"
|
||||
//config: bool "false (314 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: false returns an exit code of FALSE (1).
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config FOLD
|
||||
//config: bool "fold (4.6 kb)"
|
||||
//config: bool "fold (4.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Wrap text to fit a specific width.
|
||||
@@ -77,7 +77,7 @@ int fold_main(int argc UNUSED_PARAM, char **argv)
|
||||
char *line_out = NULL;
|
||||
const char *w_opt = "80";
|
||||
unsigned width;
|
||||
smallint exitcode = EXIT_SUCCESS;
|
||||
exitcode_t exitcode = EXIT_SUCCESS;
|
||||
|
||||
init_unicode();
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config HEAD
|
||||
//config: bool "head (3.8 kb)"
|
||||
//config: bool "head (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: head is used to print the first specified number of lines
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config HOSTID
|
||||
//config: bool "hostid (286 bytes)"
|
||||
//config: bool "hostid (566 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: hostid prints the numeric identifier (in hexadecimal) for
|
||||
|
||||
+2
-2
@@ -13,13 +13,13 @@
|
||||
* Added -G option Tito Ragusa (C) 2008 for SUSv3.
|
||||
*/
|
||||
//config:config ID
|
||||
//config: bool "id (7 kb)"
|
||||
//config: bool "id (7.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: id displays the current user and group ID names.
|
||||
//config:
|
||||
//config:config GROUPS
|
||||
//config: bool "groups (6.7 kb)"
|
||||
//config: bool "groups (6.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Print the group names associated with current user id.
|
||||
|
||||
+9
-7
@@ -244,6 +244,15 @@ int install_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the user and group id */
|
||||
/* (must be before chmod, or else chown may clear suid/gid bits) */
|
||||
if ((opts & (OPT_OWNER|OPT_GROUP))
|
||||
&& lchown(dest, uid, gid) == -1
|
||||
) {
|
||||
bb_perror_msg("can't change %s of %s", "ownership", dest);
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Set the file mode (always, not only with -m).
|
||||
* GNU coreutils 6.10 is not affected by umask. */
|
||||
if (chmod(dest, mode) == -1) {
|
||||
@@ -254,13 +263,6 @@ int install_main(int argc, char **argv)
|
||||
if (use_default_selinux_context)
|
||||
setdefaultfilecon(dest);
|
||||
#endif
|
||||
/* Set the user and group id */
|
||||
if ((opts & (OPT_OWNER|OPT_GROUP))
|
||||
&& lchown(dest, uid, gid) == -1
|
||||
) {
|
||||
bb_perror_msg("can't change %s of %s", "ownership", dest);
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
next:
|
||||
if (ENABLE_FEATURE_CLEAN_UP && isdir)
|
||||
free(dest);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config LINK
|
||||
//config: bool "link (3.2 kb)"
|
||||
//config: bool "link (3.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: link creates hard links between files.
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config LN
|
||||
//config: bool "ln (4.9 kb)"
|
||||
//config: bool "ln (5.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: ln is used to create hard or soft links between files.
|
||||
@@ -52,7 +52,7 @@
|
||||
int ln_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int ln_main(int argc, char **argv)
|
||||
{
|
||||
int status = EXIT_SUCCESS;
|
||||
exitcode_t status = EXIT_SUCCESS;
|
||||
int opts;
|
||||
char *last;
|
||||
char *src_name;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* a diagnostic message and an error return.
|
||||
*/
|
||||
//config:config LOGNAME
|
||||
//config: bool "logname (1.1 kb)"
|
||||
//config: bool "logname (1.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: logname is used to print the current user's login name.
|
||||
|
||||
+2
-2
@@ -526,10 +526,10 @@ static NOINLINE unsigned display_single(const struct dnode *dn)
|
||||
#if ENABLE_FEATURE_LS_USERNAME
|
||||
else {
|
||||
if (opt & OPT_g) {
|
||||
column += printf("%-8.8s ",
|
||||
column += printf("%-8s ",
|
||||
get_cached_groupname(dn->dn_gid));
|
||||
} else {
|
||||
column += printf("%-8.8s %-8.8s ",
|
||||
column += printf("%-8s %-8s ",
|
||||
get_cached_username(dn->dn_uid),
|
||||
get_cached_groupname(dn->dn_gid));
|
||||
}
|
||||
|
||||
@@ -6,31 +6,31 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config MD5SUM
|
||||
//config: bool "md5sum (6.5 kb)"
|
||||
//config: bool "md5sum (6.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Compute and check MD5 message digest
|
||||
//config:
|
||||
//config:config SHA1SUM
|
||||
//config: bool "sha1sum (5.9 kb)"
|
||||
//config: bool "sha1sum (6.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Compute and check SHA1 message digest
|
||||
//config:
|
||||
//config:config SHA256SUM
|
||||
//config: bool "sha256sum (7 kb)"
|
||||
//config: bool "sha256sum (8.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Compute and check SHA256 message digest
|
||||
//config:
|
||||
//config:config SHA512SUM
|
||||
//config: bool "sha512sum (7.4 kb)"
|
||||
//config: bool "sha512sum (7.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Compute and check SHA512 message digest
|
||||
//config:
|
||||
//config:config SHA3SUM
|
||||
//config: bool "sha3sum (6.1 kb)"
|
||||
//config: bool "sha3sum (6.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Compute and check SHA3 message digest
|
||||
@@ -320,7 +320,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
hash_value = hash_file(in_buf, filename_ptr, sha3_width);
|
||||
|
||||
if (hash_value && (strcmp((char*)hash_value, line) == 0)) {
|
||||
if (hash_value && (strcasecmp((char*)hash_value, line) == 0)) {
|
||||
if (!(flags & FLAG_SILENT))
|
||||
printf("%s: OK\n", filename_ptr);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
/* Nov 28, 2006 Yoshinori Sato <ysato@users.sourceforge.jp>: Add SELinux Support.
|
||||
*/
|
||||
//config:config MKDIR
|
||||
//config: bool "mkdir (4.5 kb)"
|
||||
//config: bool "mkdir (4.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: mkdir is used to create directories with the specified names.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config MKFIFO
|
||||
//config: bool "mkfifo (3.8 kb)"
|
||||
//config: bool "mkfifo (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: mkfifo is used to create FIFOs (named pipes).
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config MKNOD
|
||||
//config: bool "mknod (4.5 kb)"
|
||||
//config: bool "mknod (4.6 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: mknod is used to create FIFOs or block/character special
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
* -p; else /tmp [deprecated]
|
||||
*/
|
||||
//config:config MKTEMP
|
||||
//config: bool "mktemp (4.2 kb)"
|
||||
//config: bool "mktemp (4.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: mktemp is used to create unique temporary files
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config NICE
|
||||
//config: bool "nice (2.1 kb)"
|
||||
//config: bool "nice (2.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: nice runs a program with modified scheduling priority.
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config NL
|
||||
//config: bool "nl (4.6 kb)"
|
||||
//config: bool "nl (4.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: nl is used to number lines of files.
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config NOHUP
|
||||
//config: bool "nohup (2 kb)"
|
||||
//config: bool "nohup (2.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: run a command immune to hangups, with output to a non-tty.
|
||||
|
||||
+9
-11
@@ -4,7 +4,7 @@
|
||||
* Licensed under GPLv2, see LICENSE in this source tree
|
||||
*/
|
||||
//config:config NPROC
|
||||
//config: bool "nproc (3.7 kb)"
|
||||
//config: bool "nproc (3.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Print number of CPUs
|
||||
@@ -23,13 +23,11 @@
|
||||
//usage: "\n --ignore=N Exclude N CPUs"
|
||||
//usage: )
|
||||
|
||||
#include <sched.h>
|
||||
#include "libbb.h"
|
||||
|
||||
int nproc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int nproc_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
{
|
||||
unsigned long mask[1024];
|
||||
int count = 0;
|
||||
#if ENABLE_LONG_OPTS
|
||||
int ignore = 0;
|
||||
@@ -52,16 +50,16 @@ int nproc_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (sched_getaffinity(0, sizeof(mask), (void*)mask) == 0) {
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ARRAY_SIZE(mask); i++) {
|
||||
unsigned long m = mask[i];
|
||||
while (m) {
|
||||
if (m & 1)
|
||||
count++;
|
||||
m >>= 1;
|
||||
}
|
||||
unsigned sz = 2 * 1024;
|
||||
unsigned long *mask = get_malloc_cpu_affinity(0, &sz);
|
||||
sz /= sizeof(long);
|
||||
for (i = 0; i < sz; i++) {
|
||||
if (mask[i] != 0) /* most mask[i] are usually 0 */
|
||||
count += bb_popcnt_long(mask[i]);
|
||||
}
|
||||
IF_FEATURE_CLEAN_UP(free(mask);)
|
||||
}
|
||||
|
||||
IF_LONG_OPTS(count -= ignore;)
|
||||
|
||||
+49
-24
@@ -22,7 +22,9 @@
|
||||
|
||||
//usage:#if !ENABLE_DESKTOP
|
||||
//usage:#define od_trivial_usage
|
||||
//usage: "[-aBbcDdeFfHhIiLlOovXx] [FILE]"
|
||||
//usage: "[-abcdeFfhiloxsv] [FILE]"
|
||||
// We also support -BDOHXIL, but they are not documented in coreutils 9.1
|
||||
// manpage/help, so don't show them either.
|
||||
//usage:#define od_full_usage "\n\n"
|
||||
//usage: "Print FILE (or stdin) unambiguously, as octal bytes by default"
|
||||
//usage:#endif
|
||||
@@ -144,29 +146,50 @@ odoffset(dumper_t *dumper, int argc, char ***argvp)
|
||||
}
|
||||
}
|
||||
|
||||
// bb_dump_add():
|
||||
// A format string contains format units separated by [optional] whitespace.
|
||||
// A format unit contains up to three items: an iteration count, a byte count,
|
||||
// and a format.
|
||||
// The iteration count is an optional integer (default 1).
|
||||
// Each format is applied iteration count times.
|
||||
// The byte count is an optional integer. It defines the number
|
||||
// of bytes to be interpreted by each iteration of the format.
|
||||
// If an iteration count and/or a byte count is specified, a slash must be
|
||||
// placed after the iteration count and/or before the byte count
|
||||
// to disambiguate them.
|
||||
// The printf-style format is required and must be surrounded by " "s.
|
||||
// (Below, each string contains two format units)
|
||||
static const char *const add_strings[] ALIGN_PTR = {
|
||||
"16/1 \"%3_u \" \"\\n\"", /* a */
|
||||
"8/2 \" %06o \" \"\\n\"", /* B, o */
|
||||
"16/1 \"%03o \" \"\\n\"", /* b */
|
||||
"16/1 \"%3_c \" \"\\n\"", /* c */
|
||||
"8/2 \" %05u \" \"\\n\"", /* d */
|
||||
"4/4 \" %010u \" \"\\n\"", /* D */
|
||||
"2/8 \" %21.14e \" \"\\n\"", /* e (undocumented in od), F */
|
||||
"4/4 \" %14.7e \" \"\\n\"", /* f */
|
||||
"4/4 \" %08x \" \"\\n\"", /* H, X */
|
||||
"8/2 \" %04x \" \"\\n\"", /* h, x */
|
||||
"4/4 \" %11d \" \"\\n\"", /* I, L, l */
|
||||
"8/2 \" %6d \" \"\\n\"", /* i */
|
||||
"4/4 \" %011o \" \"\\n\"", /* O */
|
||||
"16/1 \" %3_u\"" "\"\n\"", /* 0: a */
|
||||
"8/2 \" %06o\"" "\"\n\"", /* 1: B (undocumented in od), o */
|
||||
"16/1 \" %03o\"" "\"\n\"", /* 2: b */
|
||||
"16/1 \" %3_c\"" "\"\n\"", /* 3: c */
|
||||
"8/2 \" %5u\"" "\"\n\"", /* 4: d */
|
||||
"4/4 \" %10u\"" "\"\n\"", /* 5: D */
|
||||
"2/8 \" %24.14e\"" "\"\n\"", /* 6: e (undocumented in od), F */
|
||||
"4/4 \" %15.7e\"" "\"\n\"", /* 7: f */
|
||||
"4/4 \" %08x\"" "\"\n\"", /* 8: H, X */
|
||||
"8/2 \" %04x\"" "\"\n\"", /* 9: h, x */
|
||||
"4/4 \" %11d\"" "\"\n\"", /* 10: i */
|
||||
"4/4 \" %011o\"" "\"\n\"", /* 11: O */
|
||||
"8/2 \" %6d\"" "\"\n\"", /* 12: s */
|
||||
/* -I,L,l: depend on word width of the arch (what is "long"?) */
|
||||
#if ULONG_MAX > 0xffffffff
|
||||
"2/8 \" %20lld\"" "\"\n\"", /* 13: I, L, l */
|
||||
#define L_ 13
|
||||
#else
|
||||
/* 32-bit arch: -I,L,l are the same as -i */
|
||||
#define L_ 10
|
||||
#endif
|
||||
};
|
||||
|
||||
static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxv";
|
||||
static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxsv";
|
||||
|
||||
static const char od_o2si[] ALIGN1 = {
|
||||
0, 1, 2, 3, 5,
|
||||
4, 6, 6, 7, 8,
|
||||
9, 0xa, 0xb, 0xa, 0xa,
|
||||
0xb, 1, 8, 9,
|
||||
0, 1, 2, 3, 5, /* aBbcD */
|
||||
4, 6, 6, 7, 8, /* deFfH */
|
||||
9, L_, 10, L_, L_, /* hIiLl */
|
||||
11, 1, 8, 9, 12 /* OoXxs */
|
||||
};
|
||||
|
||||
int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
@@ -184,19 +207,21 @@ int od_main(int argc, char **argv)
|
||||
if (first) {
|
||||
first = 0;
|
||||
bb_dump_add(dumper, "\"%07.7_Ao\n\"");
|
||||
bb_dump_add(dumper, "\"%07.7_ao \"");
|
||||
bb_dump_add(dumper, "\"%07.7_ao\"");
|
||||
} else {
|
||||
bb_dump_add(dumper, "\" \"");
|
||||
bb_dump_add(dumper, "\" \"");
|
||||
}
|
||||
bb_dump_add(dumper, add_strings[(int)od_o2si[(p - od_opts)]]);
|
||||
} else { /* P, p, s, w, or other unhandled */
|
||||
} else { /* P, p, w, or other unhandled */
|
||||
bb_show_usage();
|
||||
}
|
||||
}
|
||||
if (!dumper->fshead) {
|
||||
bb_dump_add(dumper, "\"%07.7_Ao\n\"");
|
||||
bb_dump_add(dumper, "\"%07.7_ao \" 8/2 \"%06o \" \"\\n\"");
|
||||
bb_dump_add(dumper, "\"%07.7_ao\"");
|
||||
bb_dump_add(dumper, add_strings[1]); /* -o format is default */
|
||||
}
|
||||
dumper->od_eofstring = "\n";
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
@@ -205,7 +230,7 @@ int od_main(int argc, char **argv)
|
||||
|
||||
return bb_dump_dump(dumper, argv);
|
||||
}
|
||||
#endif /* ENABLE_DESKTOP */
|
||||
#endif /* !ENABLE_DESKTOP */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
||||
+37
-19
@@ -27,6 +27,8 @@
|
||||
//usage:#if ENABLE_DESKTOP
|
||||
//usage:#define od_trivial_usage
|
||||
//usage: "[-abcdfhilovxs] [-t TYPE] [-A RADIX] [-N SIZE] [-j SKIP] [-S MINSTR] [-w WIDTH] [FILE]..."
|
||||
// We also support -BDOHXIL, but they are not documented in coreutils 9.1
|
||||
// manpage/help, so don't show them either.
|
||||
// We don't support:
|
||||
// ... [FILE] [[+]OFFSET[.][b]]
|
||||
// Support is buggy for:
|
||||
@@ -43,26 +45,33 @@ enum {
|
||||
OPT_b = 1 << 3,
|
||||
OPT_c = 1 << 4,
|
||||
OPT_d = 1 << 5,
|
||||
OPT_f = 1 << 6,
|
||||
OPT_h = 1 << 7,
|
||||
OPT_i = 1 << 8,
|
||||
OPT_j = 1 << 9,
|
||||
OPT_l = 1 << 10,
|
||||
OPT_o = 1 << 11,
|
||||
OPT_t = 1 << 12,
|
||||
OPT_D = 1 << 6, /* undocumented in coreutils 9.1 */
|
||||
OPT_f = 1 << 7,
|
||||
OPT_h = 1 << 8,
|
||||
OPT_H = 1 << 9, /* undocumented in coreutils 9.1 */
|
||||
OPT_i = 1 << 10,
|
||||
OPT_I = 1 << 11, /* undocumented in coreutils 9.1 */
|
||||
OPT_j = 1 << 12,
|
||||
OPT_l = 1 << 13,
|
||||
OPT_L = 1 << 14, /* undocumented in coreutils 9.1 */
|
||||
OPT_o = 1 << 15,
|
||||
OPT_O = 1 << 16, /* undocumented in coreutils 9.1 */
|
||||
OPT_B = 1 << 17, /* undocumented synonym to -o */
|
||||
OPT_t = 1 << 18,
|
||||
/* When zero and two or more consecutive blocks are equal, format
|
||||
only the first block and output an asterisk alone on the following
|
||||
line to indicate that identical blocks have been elided: */
|
||||
OPT_v = 1 << 13,
|
||||
OPT_x = 1 << 14,
|
||||
OPT_s = 1 << 15,
|
||||
OPT_S = 1 << 16,
|
||||
OPT_w = 1 << 17,
|
||||
OPT_traditional = (1 << 18) * ENABLE_LONG_OPTS,
|
||||
OPT_v = 1 << 19,
|
||||
OPT_x = 1 << 20,
|
||||
OPT_X = 1 << 21, /* undocumented in coreutils 9.1 */
|
||||
OPT_s = 1 << 22,
|
||||
OPT_S = 1 << 23,
|
||||
OPT_w = 1 << 24,
|
||||
OPT_traditional = (1 << 25) * ENABLE_LONG_OPTS,
|
||||
};
|
||||
|
||||
#define OD_GETOPT32() getopt32long(argv, \
|
||||
"A:N:abcdfhij:lot:*vxsS:w:+:", od_longopts, \
|
||||
"A:N:abcdDfhHiIj:lLoOBt:*vxXsS:w:+:", od_longopts, \
|
||||
/* -w with optional param */ \
|
||||
/* -S was -s and also had optional parameter */ \
|
||||
/* but in coreutils 6.3 it was renamed and now has */ \
|
||||
@@ -1239,20 +1248,29 @@ int od_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (opt & OPT_N) {
|
||||
max_bytes_to_format = xstrtooff_sfx(str_N, 0, bkm_suffixes);
|
||||
}
|
||||
|
||||
if (opt & OPT_a) decode_format_string("a");
|
||||
if (opt & OPT_b) decode_format_string("oC");
|
||||
if (opt & OPT_c) decode_format_string("c");
|
||||
if (opt & OPT_d) decode_format_string("u2");
|
||||
if (opt & OPT_D) decode_format_string("uI");
|
||||
if (opt & OPT_f) decode_format_string("fF");
|
||||
if (opt & OPT_h) decode_format_string("x2");
|
||||
if (opt & OPT_i) decode_format_string("d2");
|
||||
if (opt & (OPT_h|OPT_x)) decode_format_string("x2");
|
||||
if (opt & (OPT_H|OPT_X)) decode_format_string("xI");
|
||||
/* -I,L,l: depend on word width of the arch (what is "long"?) */
|
||||
#if ULONG_MAX > 0xffffffff
|
||||
if (opt & OPT_i) decode_format_string("dI");
|
||||
if (opt & (OPT_I|OPT_l|OPT_L)) decode_format_string("dL");
|
||||
#else
|
||||
/* 32-bit arch: -I,L,l are the same as -i */
|
||||
if (opt & (OPT_i|OPT_I|OPT_l|OPT_L)) decode_format_string("dI");
|
||||
#endif
|
||||
if (opt & OPT_j) n_bytes_to_skip = xstrtooff_sfx(str_j, 0, bkm_suffixes);
|
||||
if (opt & OPT_l) decode_format_string("d4");
|
||||
if (opt & OPT_o) decode_format_string("o2");
|
||||
if (opt & (OPT_o|OPT_B)) decode_format_string("o2");
|
||||
if (opt & OPT_O) decode_format_string("oI");
|
||||
while (lst_t) {
|
||||
decode_format_string(llist_pop(&lst_t));
|
||||
}
|
||||
if (opt & OPT_x) decode_format_string("x2");
|
||||
if (opt & OPT_s) decode_format_string("d2");
|
||||
if (opt & OPT_S) {
|
||||
G.string_min = xstrtou_sfx(str_S, 0, bkm_suffixes);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config PASTE
|
||||
//config: bool "paste (4.9 kb)"
|
||||
//config: bool "paste (5.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: paste is used to paste lines of different files together
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config PRINTENV
|
||||
//config: bool "printenv (1.3 kb)"
|
||||
//config: bool "printenv (1.6 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: printenv is used to print all or part of environment.
|
||||
|
||||
+7
-7
@@ -38,7 +38,7 @@
|
||||
/* 19990508 Busy Boxed! Dave Cinege */
|
||||
|
||||
//config:config PRINTF
|
||||
//config: bool "printf (3.8 kb)"
|
||||
//config: bool "printf (4.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: printf is used to format and print specified strings.
|
||||
@@ -425,10 +425,10 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
|
||||
/* bash builtin errors out on "printf '-%s-\n' foo",
|
||||
* coreutils-6.9 works. Both work with "printf -- '-%s-\n' foo".
|
||||
* We will mimic coreutils. */
|
||||
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
|
||||
argv++;
|
||||
if (!argv[1]) {
|
||||
if (ENABLE_ASH_PRINTF
|
||||
argv = skip_dash_dash(argv);
|
||||
|
||||
if (!argv[0]) {
|
||||
if ((ENABLE_ASH_PRINTF || ENABLE_HUSH_PRINTF)
|
||||
&& applet_name[0] != 'p'
|
||||
) {
|
||||
bb_simple_error_msg("usage: printf FORMAT [ARGUMENT...]");
|
||||
@@ -437,8 +437,8 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
format = argv[1];
|
||||
argv2 = argv + 2;
|
||||
format = argv[0];
|
||||
argv2 = argv + 1;
|
||||
|
||||
conv_err = 0;
|
||||
do {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config PWD
|
||||
//config: bool "pwd (3.7 kb)"
|
||||
//config: bool "pwd (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: pwd is used to print the current directory.
|
||||
|
||||
+15
-21
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config READLINK
|
||||
//config: bool "readlink (4 kb)"
|
||||
//config: bool "readlink (4.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: This program reads a symbolic link and returns the name
|
||||
@@ -25,12 +25,14 @@
|
||||
//kbuild:lib-$(CONFIG_READLINK) += readlink.o
|
||||
|
||||
//usage:#define readlink_trivial_usage
|
||||
//usage: IF_FEATURE_READLINK_FOLLOW("[-fnv] ") "FILE"
|
||||
//usage: IF_FEATURE_READLINK_FOLLOW("[-fnv] ")
|
||||
//usage: IF_NOT_FEATURE_READLINK_FOLLOW("[-n] ")
|
||||
//usage: "FILE"
|
||||
//usage:#define readlink_full_usage "\n\n"
|
||||
//usage: "Display the value of a symlink"
|
||||
//usage: IF_FEATURE_READLINK_FOLLOW( "\n"
|
||||
//usage: "\n -f Canonicalize by following all symlinks"
|
||||
//usage: "Display the value of a symlink" "\n"
|
||||
//usage: "\n -n Don't add newline"
|
||||
//usage: IF_FEATURE_READLINK_FOLLOW(
|
||||
//usage: "\n -f Canonicalize by following all symlinks"
|
||||
//usage: "\n -v Verbose"
|
||||
//usage: )
|
||||
|
||||
@@ -66,34 +68,26 @@ int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int readlink_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
char *buf;
|
||||
char *fname;
|
||||
unsigned opt;
|
||||
|
||||
IF_FEATURE_READLINK_FOLLOW(
|
||||
unsigned opt;
|
||||
/* We need exactly one non-option argument. */
|
||||
opt = getopt32(argv, "^" "fnvsq" "\0" "=1");
|
||||
fname = argv[optind];
|
||||
)
|
||||
IF_NOT_FEATURE_READLINK_FOLLOW(
|
||||
const unsigned opt = 0;
|
||||
if (argc != 2) bb_show_usage();
|
||||
fname = argv[1];
|
||||
)
|
||||
/* -n must use bit 0 (see printf below) */
|
||||
opt = getopt32(argv, "^" "n" IF_FEATURE_READLINK_FOLLOW("fvsq")
|
||||
"\0" "=1");
|
||||
|
||||
/* compat: coreutils readlink reports errors silently via exit code */
|
||||
if (!(opt & 4)) /* not -v */
|
||||
logmode = LOGMODE_NONE;
|
||||
|
||||
/* NOFORK: only one alloc is allowed; must free */
|
||||
if (opt & 1) { /* -f */
|
||||
buf = xmalloc_realpath_coreutils(fname);
|
||||
if (opt & 2) { /* -f */
|
||||
buf = xmalloc_realpath_coreutils(argv[optind]);
|
||||
} else {
|
||||
buf = xmalloc_readlink_or_warn(fname);
|
||||
buf = xmalloc_readlink_or_warn(argv[optind]);
|
||||
}
|
||||
|
||||
if (!buf)
|
||||
return EXIT_FAILURE;
|
||||
printf((opt & 2) ? "%s" : "%s\n", buf);
|
||||
printf("%s%s", buf, &"\n"[opt & 1]);
|
||||
free(buf);
|
||||
|
||||
fflush_stdout_and_exit_SUCCESS();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config REALPATH
|
||||
//config: bool "realpath (1.6 kb)"
|
||||
//config: bool "realpath (2.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Return the canonicalized absolute pathname.
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* Size reduction.
|
||||
*/
|
||||
//config:config RM
|
||||
//config: bool "rm (5.4 kb)"
|
||||
//config: bool "rm (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: rm is used to remove files or directories.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config RMDIR
|
||||
//config: bool "rmdir (3.5 kb)"
|
||||
//config: bool "rmdir (3.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: rmdir is used to remove empty directories.
|
||||
|
||||
+26
-3
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SEQ
|
||||
//config: bool "seq (3.8 kb)"
|
||||
//config: bool "seq (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: print a sequence of numbers
|
||||
@@ -22,7 +22,7 @@
|
||||
//usage:#define seq_full_usage "\n\n"
|
||||
//usage: "Print numbers from FIRST to LAST, in steps of INC.\n"
|
||||
//usage: "FIRST, INC default to 1.\n"
|
||||
//usage: "\n -w Pad to last with leading zeros"
|
||||
//usage: "\n -w Pad with leading zeros"
|
||||
//usage: "\n -s SEP String separator"
|
||||
|
||||
#include "libbb.h"
|
||||
@@ -41,6 +41,7 @@ int seq_main(int argc, char **argv)
|
||||
unsigned width;
|
||||
unsigned frac_part;
|
||||
const char *sep, *opt_s = "\n";
|
||||
char *saved;
|
||||
unsigned opt;
|
||||
|
||||
#if ENABLE_LOCALE_SUPPORT
|
||||
@@ -49,7 +50,29 @@ int seq_main(int argc, char **argv)
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
#endif
|
||||
|
||||
opt = getopt32(argv, "+ws:", &opt_s);
|
||||
/* Cater for negative arguments: if we see one, truncate argv[] on it */
|
||||
n = 0;
|
||||
for (;;) {
|
||||
char c;
|
||||
saved = argv[++n];
|
||||
if (!saved)
|
||||
break;
|
||||
if (saved[0] != '-') {
|
||||
// break; // "seq -s : -1 1" won't be treated correctly
|
||||
continue;
|
||||
}
|
||||
// "seq -s -1 1 9" is not treated correctly, but such usage
|
||||
// (delimiter string which looks like negative number) is very unlikely
|
||||
c = saved[1];
|
||||
if (c == '.' || (c >= '0' && c <= '9')) {
|
||||
argv[n] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
opt = getopt32(argv, "+ws:", &opt_s); /* "+": stop at first non-option */
|
||||
/* Restore possibly truncated argv[] */
|
||||
argv[n] = saved;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
first = increment = 1;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SHRED
|
||||
//config: bool "shred (4.9 kb)"
|
||||
//config: bool "shred (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Overwrite a file to hide its contents, and optionally delete it
|
||||
|
||||
+53
-7
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SHUF
|
||||
//config: bool "shuf (5.4 kb)"
|
||||
//config: bool "shuf (6 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Generate random permutations
|
||||
@@ -66,6 +66,12 @@ static void shuffle_lines(char **lines, unsigned numlines, unsigned outlines)
|
||||
}
|
||||
}
|
||||
|
||||
/* We can handle insanity like this:
|
||||
* shuf -i 333333333333333333333333333333001-333333333333333333333333333333019
|
||||
* but do we want to have +200 bytes of code (~40% code growth)?
|
||||
*/
|
||||
#define COMMON_PREFIX_HACK 0
|
||||
|
||||
int shuf_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int shuf_main(int argc, char **argv)
|
||||
{
|
||||
@@ -76,6 +82,11 @@ int shuf_main(int argc, char **argv)
|
||||
unsigned numlines, outlines;
|
||||
unsigned i;
|
||||
char eol;
|
||||
#if COMMON_PREFIX_HACK
|
||||
unsigned pfx_len = 0;
|
||||
unsigned padding_width = padding_width;
|
||||
const char *pfx = pfx;
|
||||
#endif
|
||||
|
||||
opts = getopt32(argv, "^"
|
||||
OPT_STR
|
||||
@@ -104,10 +115,40 @@ int shuf_main(int argc, char **argv)
|
||||
if (!dash) {
|
||||
bb_error_msg_and_die("bad range '%s'", opt_i_str);
|
||||
}
|
||||
*dash = '\0';
|
||||
*dash++ = '\0';
|
||||
#if COMMON_PREFIX_HACK
|
||||
{
|
||||
const char *a = opt_i_str;
|
||||
const char *b = dash;
|
||||
/* Skip leading zeros (they may mask that common prefix does exist) */
|
||||
while (*a == '0') a++;
|
||||
while (*b == '0') b++;
|
||||
/* Do we have a common prefix (long enough to bother)? */
|
||||
padding_width = strlen(a);
|
||||
if (padding_width > 5 && padding_width == strlen(b)) {
|
||||
/* How long is it? */
|
||||
pfx = a;
|
||||
while (isdigit(*a) && *a == *b
|
||||
&& a[1] /* "111111-111111" case: avoid xatoull("") */
|
||||
) {
|
||||
a++;
|
||||
b++;
|
||||
}
|
||||
pfx_len = a - pfx; /* can end up being 0 */
|
||||
padding_width -= pfx_len;
|
||||
} else {
|
||||
/* Undo leading zero 'eating' (think "0-9") */
|
||||
a = opt_i_str;
|
||||
b = dash;
|
||||
}
|
||||
lo = xatoull(a);
|
||||
hi = xatoull(b);
|
||||
}
|
||||
#else
|
||||
lo = xatoull(opt_i_str);
|
||||
hi = xatoull(dash + 1);
|
||||
*dash = '-';
|
||||
hi = xatoull(dash);
|
||||
#endif
|
||||
dash[-1] = '-';
|
||||
if (hi < lo)
|
||||
bb_error_msg_and_die("bad range '%s'", opt_i_str);
|
||||
hi -= lo;
|
||||
@@ -165,9 +206,14 @@ int shuf_main(int argc, char **argv)
|
||||
eol = '\0';
|
||||
|
||||
for (i = numlines - outlines; i < numlines; i++) {
|
||||
if (opts & OPT_i)
|
||||
printf("%llu%c", lo + (uintptr_t)lines[i], eol);
|
||||
else
|
||||
if (opts & OPT_i) {
|
||||
#if COMMON_PREFIX_HACK
|
||||
if (pfx_len != 0)
|
||||
printf("%.*s%0*llu%c", pfx_len, pfx, padding_width, lo + (uintptr_t)lines[i], eol);
|
||||
else
|
||||
#endif
|
||||
printf("%llu%c", lo + (uintptr_t)lines[i], eol);
|
||||
} else
|
||||
printf("%s%c", lines[i], eol);
|
||||
}
|
||||
|
||||
|
||||
+25
-10
@@ -13,18 +13,19 @@
|
||||
* time suffixes for seconds, minutes, hours, and days.
|
||||
*/
|
||||
//config:config SLEEP
|
||||
//config: bool "sleep (2 kb)"
|
||||
//config: bool "sleep (2.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: sleep is used to pause for a specified number of seconds.
|
||||
//config: It comes in 3 versions:
|
||||
//config: It comes in 2 versions:
|
||||
//config: - small: takes one integer parameter
|
||||
//config: - fancy: takes multiple integer arguments with suffixes:
|
||||
//config: sleep 1d 2h 3m 15s
|
||||
//config: - fancy with fractional numbers:
|
||||
//config: sleep 2.3s 4.5h sleeps for 16202.3 seconds
|
||||
//config: Last one is "the most compatible" with coreutils sleep,
|
||||
//config: but it adds around 1k of code.
|
||||
//config: - fancy:
|
||||
//config: * takes multiple integer arguments with suffixes:
|
||||
//config: sleep 1d 2h 3m 15s
|
||||
//config: * allows fractional numbers:
|
||||
//config: sleep 2.3s 4.5h sleeps for 16202.3 seconds
|
||||
//config: fancy is more compatible with coreutils sleep, but it adds around
|
||||
//config: 1k of code.
|
||||
//config:
|
||||
//config:config FEATURE_FANCY_SLEEP
|
||||
//config: bool "Enable multiple arguments and s/m/h/d suffixes"
|
||||
@@ -65,15 +66,29 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
duration_t duration;
|
||||
|
||||
++argv;
|
||||
if (!*argv)
|
||||
/* Note: sleep_main may be directly called from ash as a builtin.
|
||||
* This brings some complications:
|
||||
* + we can't use xfunc here
|
||||
* + we can't use bb_show_usage
|
||||
* + applet_name can be the name of the shell
|
||||
*/
|
||||
argv = skip_dash_dash(argv);
|
||||
if (!argv[0]) {
|
||||
/* Without this, bare "sleep" in ash shows _ash_ --help */
|
||||
/* (ash can be the "sh" applet as well, so check 2nd char) */
|
||||
if (ENABLE_ASH_SLEEP && applet_name[1] != 'l') {
|
||||
bb_simple_error_msg("sleep: missing operand");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
/* GNU sleep accepts "inf", "INF", "infinity" and "INFINITY" */
|
||||
if (strncasecmp(argv[0], "inf", 3) == 0)
|
||||
for (;;)
|
||||
sleep(INT_MAX);
|
||||
|
||||
//FIXME: in ash, "sleep 123qwerty" as a builtin aborts the shell
|
||||
#if ENABLE_FEATURE_FANCY_SLEEP
|
||||
duration = 0;
|
||||
do {
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
* http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html
|
||||
*/
|
||||
//config:config SORT
|
||||
//config: bool "sort (7.7 kb)"
|
||||
//config: bool "sort (8.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: sort is used to sort lines of text in specified files.
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SPLIT
|
||||
//config: bool "split (5 kb)"
|
||||
//config: bool "split (5.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Split a file into pieces.
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* Special for busybox ported by Vladimir Oleynik <dzo@simtreas.ru> 2001
|
||||
*/
|
||||
//config:config STTY
|
||||
//config: bool "stty (8.9 kb)"
|
||||
//config: bool "stty (9.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: stty is used to change and print terminal line settings.
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SUM
|
||||
//config: bool "sum (4 kb)"
|
||||
//config: bool "sum (4.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: checksum and count the blocks in a file
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config SYNC
|
||||
//config: bool "sync (3.8 kb)"
|
||||
//config: bool "sync (4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: sync is used to flush filesystem buffers.
|
||||
@@ -113,7 +113,7 @@ int sync_main(int argc UNUSED_PARAM, char **argv IF_NOT_DESKTOP(UNUSED_PARAM))
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config FSYNC
|
||||
//config: bool "fsync (3.6 kb)"
|
||||
//config: bool "fsync (3.8 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: fsync is used to flush file-related cached blocks to disk.
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* http://www.uclibc.org/lists/busybox/2003-July/008813.html
|
||||
*/
|
||||
//config:config TAC
|
||||
//config: bool "tac (3.9 kb)"
|
||||
//config: bool "tac (4.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tac is used to concatenate and print files in reverse.
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* 7) lseek attempted when count==0 even if arg was +0 (from top)
|
||||
*/
|
||||
//config:config TAIL
|
||||
//config: bool "tail (6.8 kb)"
|
||||
//config: bool "tail (7.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tail is used to print the last specified number of lines
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config TEE
|
||||
//config: bool "tee (4.2 kb)"
|
||||
//config: bool "tee (4.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tee is used to read from standard input and write
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
* "This program is in the Public Domain."
|
||||
*/
|
||||
//config:config TEST
|
||||
//config: bool "test (4.1 kb)"
|
||||
//config: bool "test (4.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: test is used to check file types and compare values,
|
||||
|
||||
+10
-5
@@ -28,7 +28,7 @@
|
||||
* rewrite 14-11-2008 vda
|
||||
*/
|
||||
//config:config TIMEOUT
|
||||
//config: bool "timeout (6 kb)"
|
||||
//config: bool "timeout (6.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Runs a program and watches it. If it does not terminate in
|
||||
@@ -47,11 +47,16 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
static NOINLINE int timeout_wait(int timeout, pid_t pid)
|
||||
static NOINLINE int timeout_wait(duration_t timeout, pid_t pid)
|
||||
{
|
||||
/* Just sleep(HUGE_NUM); kill(parent) may kill wrong process! */
|
||||
while (1) {
|
||||
sleep1();
|
||||
#if ENABLE_FLOAT_DURATION
|
||||
if (timeout < 1)
|
||||
sleep_for_duration(timeout);
|
||||
else
|
||||
#endif
|
||||
sleep1();
|
||||
if (--timeout <= 0)
|
||||
break;
|
||||
if (kill(pid, 0)) {
|
||||
@@ -68,8 +73,8 @@ int timeout_main(int argc UNUSED_PARAM, char **argv)
|
||||
int signo;
|
||||
int status;
|
||||
int parent = 0;
|
||||
int timeout;
|
||||
int kill_timeout;
|
||||
duration_t timeout;
|
||||
duration_t kill_timeout;
|
||||
pid_t pid;
|
||||
#if !BB_MMU
|
||||
char *sv1, *sv2;
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
* Also, exiting on a failure was a bug. All args should be processed.
|
||||
*/
|
||||
//config:config TOUCH
|
||||
//config: bool "touch (5.9 kb)"
|
||||
//config: bool "touch (6.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: touch is used to create or change the access and/or
|
||||
@@ -77,7 +77,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
int fd;
|
||||
int opts;
|
||||
smalluint status = EXIT_SUCCESS;
|
||||
exitcode_t status = EXIT_SUCCESS;
|
||||
#if ENABLE_FEATURE_TOUCH_SUSV3
|
||||
char *reference_file;
|
||||
char *date_str;
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
* TODO: graph, print
|
||||
*/
|
||||
//config:config TR
|
||||
//config: bool "tr (5.1 kb)"
|
||||
//config: bool "tr (5.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tr is used to squeeze, and/or delete characters from standard
|
||||
@@ -299,7 +299,7 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
|
||||
*/
|
||||
|
||||
/* '+': stop at first non-option */
|
||||
opts = getopt32(argv, "^+" "Ccds" "\0" "-1");
|
||||
opts = getopt32(argv, "^+" "Ccds" "\0" "-1:?2");
|
||||
argv += optind;
|
||||
|
||||
str1_length = expand(*argv++, &str1);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config TRUE
|
||||
//config: bool "true (tiny)"
|
||||
//config: bool "true (311 bytes)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: true returns an exit code of TRUE (0).
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config TRUNCATE
|
||||
//config: bool "truncate (4.2 kb)"
|
||||
//config: bool "truncate (4.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: truncate truncates files to a given size. If a file does
|
||||
|
||||
+18
-4
@@ -5,7 +5,7 @@
|
||||
* public domain -- David Leonard, 2022
|
||||
*/
|
||||
//config:config TSORT
|
||||
//config: bool "tsort (0.7 kb)"
|
||||
//config: bool "tsort (2.6 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tsort performs a topological sort.
|
||||
@@ -101,6 +101,10 @@ int tsort_main(int argc UNUSED_PARAM, char **argv)
|
||||
ssize_t len;
|
||||
struct node *a;
|
||||
int cycles;
|
||||
unsigned i;
|
||||
#if ENABLE_FEATURE_CLEAN_UP
|
||||
unsigned max_len;
|
||||
#endif
|
||||
|
||||
INIT_G();
|
||||
|
||||
@@ -152,9 +156,11 @@ int tsort_main(int argc UNUSED_PARAM, char **argv)
|
||||
* - if any nodes are left, they form cycles.
|
||||
*/
|
||||
cycles = 0;
|
||||
#if ENABLE_FEATURE_CLEAN_UP
|
||||
max_len = G.nodes_len;
|
||||
#endif
|
||||
while (G.nodes_len) {
|
||||
struct node *n;
|
||||
unsigned i;
|
||||
|
||||
/* Search for first node with no incoming edges */
|
||||
for (i = 0; i < G.nodes_len; i++) {
|
||||
@@ -173,16 +179,24 @@ int tsort_main(int argc UNUSED_PARAM, char **argv)
|
||||
/* Remove the node (need no longer maintain sort) */
|
||||
n = G.nodes[i];
|
||||
G.nodes[i] = G.nodes[--G.nodes_len];
|
||||
#if ENABLE_FEATURE_CLEAN_UP
|
||||
/* Keep reference to removed node so it can be freed */
|
||||
G.nodes[G.nodes_len] = n;
|
||||
#endif
|
||||
|
||||
/* And remove its outgoing edges */
|
||||
for (i = 0; i < n->out_count; i++)
|
||||
n->out[i]->in_count--;
|
||||
free(n->out);
|
||||
|
||||
puts(n->name);
|
||||
free(n);
|
||||
}
|
||||
#if ENABLE_FEATURE_CLEAN_UP
|
||||
for (i = 0; i < max_len; i++) {
|
||||
free(G.nodes[i]->out);
|
||||
free(G.nodes[i]);
|
||||
}
|
||||
free(G.nodes);
|
||||
#endif
|
||||
|
||||
fflush_stdout_and_exit(cycles ? 1 : 0);
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config TTY
|
||||
//config: bool "tty (3.6 kb)"
|
||||
//config: bool "tty (3.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: tty is used to print the name of the current terminal to
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@
|
||||
* Fix handling of -a to not print "unknown", add -o and -i support.
|
||||
*/
|
||||
//config:config UNAME
|
||||
//config: bool "uname (3.9 kb)"
|
||||
//config: bool "uname (4.2 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: uname is used to print system information.
|
||||
@@ -59,7 +59,7 @@
|
||||
//config:
|
||||
//can't use "ARCH" for this applet, all hell breaks loose in build system :)
|
||||
//config:config BB_ARCH
|
||||
//config: bool "arch (1.1 kb)"
|
||||
//config: bool "arch (1.4 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Same as uname -m.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config UNIQ
|
||||
//config: bool "uniq (4.9 kb)"
|
||||
//config: bool "uniq (5.1 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: uniq is used to remove duplicate lines from a sorted file.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2, see LICENSE in this source tree
|
||||
*/
|
||||
//config:config UNLINK
|
||||
//config: bool "unlink (3.2 kb)"
|
||||
//config: bool "unlink (3.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: unlink deletes a file by calling unlink()
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config USLEEP
|
||||
//config: bool "usleep (1.3 kb)"
|
||||
//config: bool "usleep (1.6 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: usleep is used to pause for a specified number of microseconds.
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* "end" line
|
||||
*/
|
||||
//config:config UUDECODE
|
||||
//config: bool "uudecode (5.8 kb)"
|
||||
//config: bool "uudecode (5.9 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: uudecode is used to decode a uuencoded file.
|
||||
@@ -178,13 +178,13 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv)
|
||||
#endif
|
||||
|
||||
//config:config BASE32
|
||||
//config: bool "base32 (4.9 kb)"
|
||||
//config: bool "base32 (5.5 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Base32 encode and decode
|
||||
|
||||
//config:config BASE64
|
||||
//config: bool "base64 (4.9 kb)"
|
||||
//config: bool "base64 (5.3 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: Base64 encode and decode
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
//config:config UUENCODE
|
||||
//config: bool "uuencode (4.4 kb)"
|
||||
//config: bool "uuencode (4.7 kb)"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: uuencode is used to uuencode a file.
|
||||
|
||||
Loaded 100 of 454 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user