aboutsummaryrefslogtreecommitdiff
path: root/util-linux
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 /util-linux
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 'util-linux')
-rw-r--r--util-linux/mdev.c5
-rw-r--r--util-linux/mount.c3
-rw-r--r--util-linux/swaponoff.c3
3 files changed, 11 insertions, 0 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 27b35572d..c56741b08 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -173,6 +173,8 @@ struct globals {
173 char *subsystem; 173 char *subsystem;
174} FIX_ALIASING; 174} FIX_ALIASING;
175#define G (*(struct globals*)&bb_common_bufsiz1) 175#define G (*(struct globals*)&bb_common_bufsiz1)
176#define INIT_G() do { } while (0)
177
176 178
177/* Prevent infinite loops in /sys symlinks */ 179/* Prevent infinite loops in /sys symlinks */
178#define MAX_SYSFS_DEPTH 3 180#define MAX_SYSFS_DEPTH 3
@@ -180,6 +182,7 @@ struct globals {
180/* We use additional 64+ bytes in make_device() */ 182/* We use additional 64+ bytes in make_device() */
181#define SCRATCH_SIZE 80 183#define SCRATCH_SIZE 80
182 184
185
183/* Builds an alias path. 186/* Builds an alias path.
184 * This function potentionally reallocates the alias parameter. 187 * This function potentionally reallocates the alias parameter.
185 * Only used for ENABLE_FEATURE_MDEV_RENAME 188 * Only used for ENABLE_FEATURE_MDEV_RENAME
@@ -613,6 +616,8 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
613{ 616{
614 RESERVE_CONFIG_BUFFER(temp, PATH_MAX + SCRATCH_SIZE); 617 RESERVE_CONFIG_BUFFER(temp, PATH_MAX + SCRATCH_SIZE);
615 618
619 INIT_G();
620
616 /* We can be called as hotplug helper */ 621 /* We can be called as hotplug helper */
617 /* Kernel cannot provide suitable stdio fds for us, do it ourself */ 622 /* Kernel cannot provide suitable stdio fds for us, do it ourself */
618 bb_sanitize_stdio(); 623 bb_sanitize_stdio();
diff --git a/util-linux/mount.c b/util-linux/mount.c
index b51ab1782..56276ef01 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -339,6 +339,7 @@ enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_b
339#endif 339#endif
340#define fslist (G.fslist ) 340#define fslist (G.fslist )
341#define getmntent_buf (G.getmntent_buf ) 341#define getmntent_buf (G.getmntent_buf )
342#define INIT_G() do { } while (0)
342 343
343#if ENABLE_FEATURE_MTAB_SUPPORT 344#if ENABLE_FEATURE_MTAB_SUPPORT
344/* 345/*
@@ -1944,6 +1945,8 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
1944 1945
1945 IF_DESKTOP(int nonroot = ) sanitize_env_if_suid(); 1946 IF_DESKTOP(int nonroot = ) sanitize_env_if_suid();
1946 1947
1948 INIT_G();
1949
1947 // Parse long options, like --bind and --move. Note that -o option 1950 // Parse long options, like --bind and --move. Note that -o option
1948 // and --option are synonymous. Yes, this means --remount,rw works. 1951 // and --option are synonymous. Yes, this means --remount,rw works.
1949 for (i = j = 1; argv[i]; i++) { 1952 for (i = j = 1; argv[i]; i++) {
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e53e24c71..b3057b309 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -48,6 +48,7 @@ struct globals {
48#else 48#else
49#define g_flags 0 49#define g_flags 0
50#endif 50#endif
51#define INIT_G() do { } while (0)
51 52
52static int swap_enable_disable(char *device) 53static int swap_enable_disable(char *device)
53{ 54{
@@ -111,6 +112,8 @@ int swap_on_off_main(int argc UNUSED_PARAM, char **argv)
111{ 112{
112 int ret; 113 int ret;
113 114
115 INIT_G();
116
114#if !ENABLE_FEATURE_SWAPON_PRI 117#if !ENABLE_FEATURE_SWAPON_PRI
115 ret = getopt32(argv, "a"); 118 ret = getopt32(argv, "a");
116#else 119#else