summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
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 b8bbe3d..34a549f 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -88,6 +88,7 @@ struct globals {
dev_t dir_dev;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
+#define INIT_G() do { } while (0)
static void print(unsigned long size, const char *filename)
@@ -193,6 +194,8 @@ int du_main(int argc UNUSED_PARAM, char **argv)
int slink_depth_save;
unsigned opt;
+ INIT_G();
+
#if ENABLE_FEATURE_HUMAN_READABLE
IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 1024;)
IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 512;)
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 24e75b5..c986f93 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -100,6 +100,7 @@ struct globals {
char **args;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
+#define INIT_G() do { } while (0)
/* forward declarations */
static VALUE *eval(void);
@@ -519,6 +520,8 @@ int expr_main(int argc UNUSED_PARAM, char **argv)
{
VALUE *v;
+ INIT_G();
+
xfunc_error_retval = 2; /* coreutils compat */
G.args = argv + 1;
if (*G.args == NULL) {
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 43cecbd..b376ec8 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -62,6 +62,7 @@ struct globals {
bool exitcode;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
+#define INIT_G() do { } while (0)
static void tail_xprint_header(const char *fmt, const char *filename)
{
@@ -120,6 +121,8 @@ int tail_main(int argc, char **argv)
int *fds;
const char *fmt;
+ INIT_G();
+
#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL
/* Allow legacy syntax of an initial numeric option without -n. */
if (argv[1] && (argv[1][0] == '+' || argv[1][0] == '-')