From 47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 21 Apr 2016 18:18:48 +0200 Subject: *: add most of the required setup_common_bufsiz() calls Signed-off-by: Denys Vlasenko --- util-linux/mdev.c | 1 + util-linux/mkswap.c | 3 +++ util-linux/more.c | 2 +- util-linux/mount.c | 2 +- util-linux/swaponoff.c | 2 +- util-linux/uevent.c | 3 +++ 6 files changed, 10 insertions(+), 3 deletions(-) (limited to 'util-linux') diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 7473b1855..37514eb54 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -288,6 +288,7 @@ struct globals { } FIX_ALIASING; #define G (*(struct globals*)bb_common_bufsiz1) #define INIT_G() do { \ + setup_common_bufsiz(); \ IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \ IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \ } while (0) diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index f9451792b..dcb53f008 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -76,6 +76,7 @@ struct swap_header_v1 { #define NWORDS 129 #define hdr ((struct swap_header_v1*)bb_common_bufsiz1) +#define INIT_G() do { setup_common_bufsiz(); } while (0) struct BUG_sizes { char swap_header_v1_wrong[sizeof(*hdr) != (NWORDS * 4) ? -1 : 1]; @@ -93,6 +94,8 @@ int mkswap_main(int argc UNUSED_PARAM, char **argv) off_t len; const char *label = ""; + INIT_G(); + opt_complementary = "-1"; /* at least one param */ /* TODO: -p PAGESZ, -U UUID */ getopt32(argv, "L:", &label); diff --git a/util-linux/more.c b/util-linux/more.c index 58be3ac3b..95cbdd994 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -33,10 +33,10 @@ struct globals { struct termios new_settings; } FIX_ALIASING; #define G (*(struct globals*)bb_common_bufsiz1) -#define INIT_G() ((void)0) #define initial_settings (G.initial_settings) #define new_settings (G.new_settings ) #define cin_fileno (G.cin_fileno ) +#define INIT_G() do { setup_common_bufsiz(); } while (0) #define setTermSettings(fd, argp) \ do { \ diff --git a/util-linux/mount.c b/util-linux/mount.c index e5c85feff..244f4fa27 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -457,7 +457,7 @@ enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_b #endif #define fslist (G.fslist ) #define getmntent_buf (G.getmntent_buf ) -#define INIT_G() do { } while (0) +#define INIT_G() do { setup_common_bufsiz(); } while (0) #if ENABLE_FEATURE_MTAB_SUPPORT /* diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 43228a6ba..6713852e5 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -72,7 +72,7 @@ struct globals { #define save_g_flags() ((void)0) #define restore_g_flags() ((void)0) #endif -#define INIT_G() do { } while (0) +#define INIT_G() do { setup_common_bufsiz(); } while (0) #define do_swapoff (applet_name[5] == 'f') diff --git a/util-linux/uevent.c b/util-linux/uevent.c index 58668fa5d..b98fe6160 100644 --- a/util-linux/uevent.c +++ b/util-linux/uevent.c @@ -31,6 +31,7 @@ #define BUFFER_SIZE 16*1024 #define env ((char **)bb_common_bufsiz1) +#define INIT_G() do { setup_common_bufsiz(); } while (0) enum { MAX_ENV = COMMON_BUFSIZE / sizeof(env[0]) - 1, }; @@ -46,6 +47,8 @@ int uevent_main(int argc UNUSED_PARAM, char **argv) struct sockaddr_nl sa; int fd; + INIT_G(); + argv++; // Subscribe for UEVENT kernel messages -- cgit v1.2.3