*: add most of the required setup_common_bufsiz() calls

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2016-04-21 18:18:48 +02:00
parent e6a2f4cc5a
commit 47cfbf32fd
53 changed files with 63 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ struct globals {
#endif
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { } while (0)
#define INIT_G() do { setup_common_bufsiz(); } while (0)
static unsigned long long scale(unsigned long d)

View File

@@ -46,6 +46,7 @@ struct globals {
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
setup_common_bufsiz(); \
G.mypid = getpid(); \
G.killsig = SIGKILL; \
} while (0)

View File

@@ -153,7 +153,7 @@ struct globals {
#define buffer (G.buffer )
#define terminal_width (G.terminal_width )
#define kernel_HZ (G.kernel_HZ )
#define INIT_G() do { } while (0)
#define INIT_G() do { setup_common_bufsiz(); } while (0)
#if ENABLE_FEATURE_PS_TIME
/* for ELF executables, notes are pushed before environment and args */

View File

@@ -202,6 +202,7 @@ enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) };
#define total_pcpu (G.total_pcpu )
#define line_buf (G.line_buf )
#define INIT_G() do { \
setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \
} while (0)