diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/top.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/procps/top.c b/procps/top.c index 3d67c3cfd..9a3f171ac 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -184,10 +184,6 @@ struct globals { | |||
184 | }; //FIX_ALIASING; - large code growth | 184 | }; //FIX_ALIASING; - large code growth |
185 | enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; | 185 | enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; |
186 | #define G (*(struct globals*)&bb_common_bufsiz1) | 186 | #define G (*(struct globals*)&bb_common_bufsiz1) |
187 | struct BUG_bad_size { | ||
188 | char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; | ||
189 | char BUG_line_buf_too_small[LINE_BUF_SIZE > 80 ? 1 : -1]; | ||
190 | }; | ||
191 | #define top (G.top ) | 187 | #define top (G.top ) |
192 | #define ntop (G.ntop ) | 188 | #define ntop (G.ntop ) |
193 | #define sort_field (G.sort_field ) | 189 | #define sort_field (G.sort_field ) |
@@ -204,7 +200,10 @@ struct BUG_bad_size { | |||
204 | #define num_cpus (G.num_cpus ) | 200 | #define num_cpus (G.num_cpus ) |
205 | #define total_pcpu (G.total_pcpu ) | 201 | #define total_pcpu (G.total_pcpu ) |
206 | #define line_buf (G.line_buf ) | 202 | #define line_buf (G.line_buf ) |
207 | #define INIT_G() do { } while (0) | 203 | #define INIT_G() do { \ |
204 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | ||
205 | BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \ | ||
206 | } while (0) | ||
208 | 207 | ||
209 | enum { | 208 | enum { |
210 | OPT_d = (1 << 0), | 209 | OPT_d = (1 << 0), |