aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-10-13 14:37:51 +0100
committerRon Yorston <rmy@pobox.com>2021-10-13 14:37:51 +0100
commit0ecf1aea459571b48dc68ddc2b7b9265740fa960 (patch)
tree491d6184a44b8b525a4ca35759d622aecd7f6344 /coreutils
parent4859ddcb20616718efbea12c6bf8b27c469b68de (diff)
parentaaf3d5ba74c5da97ff80b61f30cb8dd225d39096 (diff)
downloadbusybox-w32-0ecf1aea459571b48dc68ddc2b7b9265740fa960.tar.gz
busybox-w32-0ecf1aea459571b48dc68ddc2b7b9265740fa960.tar.bz2
busybox-w32-0ecf1aea459571b48dc68ddc2b7b9265740fa960.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/Config.src19
-rw-r--r--coreutils/df.c20
-rw-r--r--coreutils/mktemp.c16
-rw-r--r--coreutils/test.c5
4 files changed, 52 insertions, 8 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src
index 1bded03a6..6c9e47551 100644
--- a/coreutils/Config.src
+++ b/coreutils/Config.src
@@ -5,10 +5,6 @@
5 5
6menu "Coreutils" 6menu "Coreutils"
7 7
8INSERT
9
10comment "Common options"
11
12config FEATURE_VERBOSE 8config FEATURE_VERBOSE
13 bool "Support verbose options (usually -v) for various applets" 9 bool "Support verbose options (usually -v) for various applets"
14 default y 10 default y
@@ -17,6 +13,19 @@ config FEATURE_VERBOSE
17 Also enables long option (--verbose) if it exists. 13 Also enables long option (--verbose) if it exists.
18 Without this option, -v is accepted but ignored. 14 Without this option, -v is accepted but ignored.
19 15
16comment "Common options for date and touch"
17
18config FEATURE_TIMEZONE
19 bool "Allow timezone in dates"
20 default y
21 depends on DESKTOP
22 help
23 Permit the use of timezones when parsing user-provided data
24 strings, e.g. '1996-04-09 12:45:00 -0500'.
25
26 This requires support for the '%z' extension to strptime() which
27 may not be available in all implementations.
28
20comment "Common options for cp and mv" 29comment "Common options for cp and mv"
21 depends on CP || MV 30 depends on CP || MV
22 31
@@ -37,4 +46,6 @@ config FEATURE_HUMAN_READABLE
37 help 46 help
38 Allow df, du, and ls to have human readable output. 47 Allow df, du, and ls to have human readable output.
39 48
49INSERT
50
40endmenu 51endmenu
diff --git a/coreutils/df.c b/coreutils/df.c
index 9f8b3a71e..176aa079f 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -32,6 +32,26 @@
32//config: -a Show all filesystems 32//config: -a Show all filesystems
33//config: -i Inodes 33//config: -i Inodes
34//config: -B <SIZE> Blocksize 34//config: -B <SIZE> Blocksize
35//config:
36//config:config FEATURE_SKIP_ROOTFS
37//config: bool "Skip rootfs in mount table"
38//config: default y
39//config: depends on DF
40//config: help
41//config: Ignore rootfs entry in mount table.
42//config:
43//config: In Linux, kernel has a special filesystem, rootfs, which is initially
44//config: mounted on /. It contains initramfs data, if kernel is configured
45//config: to have one. Usually, another file system is mounted over / early
46//config: in boot process, and therefore most tools which manipulate
47//config: mount table, such as df, will skip rootfs entry.
48//config:
49//config: However, some systems do not mount anything on /.
50//config: If you need to configure busybox for one of these systems,
51//config: you may find it useful to turn this option off to make df show
52//config: initramfs statistics.
53//config:
54//config: Otherwise, choose Y.
35 55
36//applet:IF_DF(APPLET_NOEXEC(df, df, BB_DIR_BIN, BB_SUID_DROP, df)) 56//applet:IF_DF(APPLET_NOEXEC(df, df, BB_DIR_BIN, BB_SUID_DROP, df))
37 57
diff --git a/coreutils/mktemp.c b/coreutils/mktemp.c
index 5393320a5..33e2720de 100644
--- a/coreutils/mktemp.c
+++ b/coreutils/mktemp.c
@@ -72,13 +72,27 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
72 OPT_t = 1 << 2, 72 OPT_t = 1 << 2,
73 OPT_p = 1 << 3, 73 OPT_p = 1 << 3,
74 OPT_u = 1 << 4, 74 OPT_u = 1 << 4,
75 OPT_tmpdir = (1 << 5) * ENABLE_LONG_OPTS,
75 }; 76 };
76 77
77 path = getenv("TMPDIR"); 78 path = getenv("TMPDIR");
78 if (!path || path[0] == '\0') 79 if (!path || path[0] == '\0')
79 path = "/tmp"; 80 path = "/tmp";
80 81
82#if ENABLE_LONG_OPTS
83 opts = getopt32long(argv, "^"
84 "dqtp:u"
85 "\0"
86 "?1" /* 1 arg max */,
87 "directory\0" No_argument "d"
88 "quiet\0" No_argument "q"
89 "dry-run\0" No_argument "u"
90 "tmpdir\0" Optional_argument "\xff"
91 , &path, &path
92 );
93#else
81 opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path); 94 opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path);
95#endif
82 96
83 chp = argv[optind]; 97 chp = argv[optind];
84 if (!chp) { 98 if (!chp) {
@@ -95,7 +109,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
95 goto error; 109 goto error;
96 } 110 }
97#endif 111#endif
98 if (opts & (OPT_t|OPT_p)) 112 if (opts & (OPT_t|OPT_p|OPT_tmpdir))
99 chp = concat_path_file(path, chp); 113 chp = concat_path_file(path, chp);
100 114
101 if (opts & OPT_u) { 115 if (opts & OPT_u) {
diff --git a/coreutils/test.c b/coreutils/test.c
index 7c6574334..a914c7490 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -435,7 +435,7 @@ struct test_statics {
435}; 435};
436 436
437/* See test_ptr_hack.c */ 437/* See test_ptr_hack.c */
438extern struct test_statics *const test_ptr_to_statics; 438extern struct test_statics *BB_GLOBAL_CONST test_ptr_to_statics;
439 439
440#define S (*test_ptr_to_statics) 440#define S (*test_ptr_to_statics)
441#define args (S.args ) 441#define args (S.args )
@@ -446,8 +446,7 @@ extern struct test_statics *const test_ptr_to_statics;
446#define leaving (S.leaving ) 446#define leaving (S.leaving )
447 447
448#define INIT_S() do { \ 448#define INIT_S() do { \
449 (*(struct test_statics**)not_const_pp(&test_ptr_to_statics)) = xzalloc(sizeof(S)); \ 449 XZALLOC_CONST_PTR(&test_ptr_to_statics, sizeof(S)); \
450 barrier(); \
451} while (0) 450} while (0)
452#define DEINIT_S() do { \ 451#define DEINIT_S() do { \
453 free(group_array); \ 452 free(group_array); \