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)
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;)
char **args;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
+#define INIT_G() do { } while (0)
/* forward declarations */
static VALUE *eval(void);
{
VALUE *v;
+ INIT_G();
+
xfunc_error_retval = 2; /* coreutils compat */
G.args = argv + 1;
if (*G.args == NULL) {
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)
{
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] == '-')
void *xmalloc(size_t size) FAST_FUNC RETURNS_MALLOC;
void *xzalloc(size_t size) FAST_FUNC RETURNS_MALLOC;
void *xrealloc(void *old, size_t size) FAST_FUNC;
-/* After xrealloc_vector(v, 4, idx) it's ok to use
+/* After v = xrealloc_vector(v, SHIFT, idx) it's ok to use
* at least v[idx] and v[idx+1], for all idx values.
- * shift specifies how many new elements are added (1: 2, 2: 4... 8: 256...)
- * when all elements are used up. New elements are zeroed out. */
+ * SHIFT specifies how many new elements are added (1:2, 2:4, ..., 8:256...)
+ * when all elements are used up. New elements are zeroed out.
+ * xrealloc_vector(v, SHIFT, idx) *MUST* be called with consecutive IDXs -
+ * skipping an index is a bad bug - it may miss a realloc!
+ */
#define xrealloc_vector(vector, shift, idx) \
xrealloc_vector_helper((vector), (sizeof((vector)[0]) << 8) + (shift), (idx))
void* xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, int idx) FAST_FUNC;
#define hwif_data (G.hwif_data )
#define hwif_ctrl (G.hwif_ctrl )
#define hwif_irq (G.hwif_irq )
+#define INIT_G() do { } while (0)
/* Busybox messages and functions */
int c;
int flagcount = 0;
+ INIT_G();
+
while ((c = getopt(argc, argv, hdparm_options)) >= 0) {
flagcount++;
IF_FEATURE_HDPARM_GET_IDENTITY(get_IDentity |= (c == 'I'));
#define G (*(struct globals*)&bb_common_bufsiz1)
#define saddr (G.saddr )
#define eth_addr (G.eth_addr)
+#define INIT_G() do { } while (0)
/**
#define verbose (L.verbose )
memset(&L, 0, sizeof(L));
+ INIT_G();
#define FOREGROUND (opts & 1)
#define QUIT (opts & 2)
char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
char BUG_line_buf_too_small[LINE_BUF_SIZE > 80 ? 1 : -1];
};
-#define INIT_G() do { } while (0)
#define top (G.top )
#define ntop (G.ntop )
#define sort_field (G.sort_field )
#define num_cpus (G.num_cpus )
#define total_pcpu (G.total_pcpu )
#define line_buf (G.line_buf )
+#define INIT_G() do { } while (0)
enum {
OPT_d = (1 << 0),
#define logpipe (G.logpipe )
#define pfd (G.pfd )
#define stamplog (G.stamplog )
-#define INIT_G() do { \
-} while (0)
+#define INIT_G() do { } while (0)
static void fatal2_cannot(const char *m1, const char *m2)
{
char *subsystem;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
+#define INIT_G() do { } while (0)
+
/* Prevent infinite loops in /sys symlinks */
#define MAX_SYSFS_DEPTH 3
/* We use additional 64+ bytes in make_device() */
#define SCRATCH_SIZE 80
+
/* Builds an alias path.
* This function potentionally reallocates the alias parameter.
* Only used for ENABLE_FEATURE_MDEV_RENAME
{
RESERVE_CONFIG_BUFFER(temp, PATH_MAX + SCRATCH_SIZE);
+ INIT_G();
+
/* We can be called as hotplug helper */
/* Kernel cannot provide suitable stdio fds for us, do it ourself */
bb_sanitize_stdio();
#endif
#define fslist (G.fslist )
#define getmntent_buf (G.getmntent_buf )
+#define INIT_G() do { } while (0)
#if ENABLE_FEATURE_MTAB_SUPPORT
/*
IF_DESKTOP(int nonroot = ) sanitize_env_if_suid();
+ INIT_G();
+
// Parse long options, like --bind and --move. Note that -o option
// and --option are synonymous. Yes, this means --remount,rw works.
for (i = j = 1; argv[i]; i++) {
#else
#define g_flags 0
#endif
+#define INIT_G() do { } while (0)
static int swap_enable_disable(char *device)
{
{
int ret;
+ INIT_G();
+
#if !ENABLE_FEATURE_SWAPON_PRI
ret = getopt32(argv, "a");
#else