aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-09-21 01:59:15 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-09-21 01:59:15 +0200
commit16714245f9a16ce3725aab079aea7b0d28c6b32f (patch)
tree41edbcd1c279b2baae2d5e5751639076e0a3bfad /coreutils
parent5c6ba6c56f9653488e1d805e727bb06c39ed23fa (diff)
downloadbusybox-w32-16714245f9a16ce3725aab079aea7b0d28c6b32f.tar.gz
busybox-w32-16714245f9a16ce3725aab079aea7b0d28c6b32f.tar.bz2
busybox-w32-16714245f9a16ce3725aab079aea7b0d28c6b32f.zip
add INIT_G()'s. No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/du.c3
-rw-r--r--coreutils/expr.c3
-rw-r--r--coreutils/tail.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/coreutils/du.c b/coreutils/du.c
index b8bbe3d9e..34a549f02 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -88,6 +88,7 @@ struct globals {
88 dev_t dir_dev; 88 dev_t dir_dev;
89} FIX_ALIASING; 89} FIX_ALIASING;
90#define G (*(struct globals*)&bb_common_bufsiz1) 90#define G (*(struct globals*)&bb_common_bufsiz1)
91#define INIT_G() do { } while (0)
91 92
92 93
93static void print(unsigned long size, const char *filename) 94static void print(unsigned long size, const char *filename)
@@ -193,6 +194,8 @@ int du_main(int argc UNUSED_PARAM, char **argv)
193 int slink_depth_save; 194 int slink_depth_save;
194 unsigned opt; 195 unsigned opt;
195 196
197 INIT_G();
198
196#if ENABLE_FEATURE_HUMAN_READABLE 199#if ENABLE_FEATURE_HUMAN_READABLE
197 IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 1024;) 200 IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 1024;)
198 IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 512;) 201 IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 512;)
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 24e75b556..c986f9327 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -100,6 +100,7 @@ struct globals {
100 char **args; 100 char **args;
101} FIX_ALIASING; 101} FIX_ALIASING;
102#define G (*(struct globals*)&bb_common_bufsiz1) 102#define G (*(struct globals*)&bb_common_bufsiz1)
103#define INIT_G() do { } while (0)
103 104
104/* forward declarations */ 105/* forward declarations */
105static VALUE *eval(void); 106static VALUE *eval(void);
@@ -519,6 +520,8 @@ int expr_main(int argc UNUSED_PARAM, char **argv)
519{ 520{
520 VALUE *v; 521 VALUE *v;
521 522
523 INIT_G();
524
522 xfunc_error_retval = 2; /* coreutils compat */ 525 xfunc_error_retval = 2; /* coreutils compat */
523 G.args = argv + 1; 526 G.args = argv + 1;
524 if (*G.args == NULL) { 527 if (*G.args == NULL) {
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 43cecbd97..b376ec863 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -62,6 +62,7 @@ struct globals {
62 bool exitcode; 62 bool exitcode;
63} FIX_ALIASING; 63} FIX_ALIASING;
64#define G (*(struct globals*)&bb_common_bufsiz1) 64#define G (*(struct globals*)&bb_common_bufsiz1)
65#define INIT_G() do { } while (0)
65 66
66static void tail_xprint_header(const char *fmt, const char *filename) 67static void tail_xprint_header(const char *fmt, const char *filename)
67{ 68{
@@ -120,6 +121,8 @@ int tail_main(int argc, char **argv)
120 int *fds; 121 int *fds;
121 const char *fmt; 122 const char *fmt;
122 123
124 INIT_G();
125
123#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL 126#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL
124 /* Allow legacy syntax of an initial numeric option without -n. */ 127 /* Allow legacy syntax of an initial numeric option without -n. */
125 if (argv[1] && (argv[1][0] == '+' || argv[1][0] == '-') 128 if (argv[1] && (argv[1][0] == '+' || argv[1][0] == '-')