aboutsummaryrefslogtreecommitdiff
path: root/miscutils/nmeter.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/nmeter.c')
-rw-r--r--miscutils/nmeter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/miscutils/nmeter.c b/miscutils/nmeter.c
index 3152b74e3..1d58eb2c1 100644
--- a/miscutils/nmeter.c
+++ b/miscutils/nmeter.c
@@ -69,16 +69,16 @@ struct globals {
69#define proc_meminfo (G.proc_meminfo ) 69#define proc_meminfo (G.proc_meminfo )
70#define proc_diskstats (G.proc_diskstats ) 70#define proc_diskstats (G.proc_diskstats )
71#define proc_sys_fs_filenr (G.proc_sys_fs_filenr) 71#define proc_sys_fs_filenr (G.proc_sys_fs_filenr)
72
73// We depend on this being a char[], not char* - we take sizeof() of it
74#define outbuf bb_common_bufsiz1
75
76#define INIT_G() do { \ 72#define INIT_G() do { \
73 PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
77 cur_outbuf = outbuf; \ 74 cur_outbuf = outbuf; \
78 final_str = "\n"; \ 75 final_str = "\n"; \
79 deltanz = delta = 1000000; \ 76 deltanz = delta = 1000000; \
80 } while (0) 77 } while (0)
81 78
79// We depend on this being a char[], not char* - we take sizeof() of it
80#define outbuf bb_common_bufsiz1
81
82static inline void reset_outbuf(void) 82static inline void reset_outbuf(void)
83{ 83{
84 cur_outbuf = outbuf; 84 cur_outbuf = outbuf;
@@ -774,7 +774,6 @@ int nmeter_main(int argc, char **argv)
774 s_stat *s; 774 s_stat *s;
775 char *cur, *prev; 775 char *cur, *prev;
776 776
777 PTR_TO_GLOBALS = xzalloc(sizeof(G));
778 INIT_G(); 777 INIT_G();
779 778
780 xchdir("/proc"); 779 xchdir("/proc");