diff options
Diffstat (limited to 'networking/nc_bloaty.c')
-rw-r--r-- | networking/nc_bloaty.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index dd62e5df7..cd014781b 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c | |||
@@ -97,7 +97,6 @@ struct globals { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | #define G (*ptr_to_globals) | 99 | #define G (*ptr_to_globals) |
100 | |||
101 | #define wrote_out (G.wrote_out ) | 100 | #define wrote_out (G.wrote_out ) |
102 | #define wrote_net (G.wrote_net ) | 101 | #define wrote_net (G.wrote_net ) |
103 | #define ouraddr (G.ouraddr ) | 102 | #define ouraddr (G.ouraddr ) |
@@ -115,6 +114,10 @@ struct globals { | |||
115 | #else | 114 | #else |
116 | #define o_interval 0 | 115 | #define o_interval 0 |
117 | #endif | 116 | #endif |
117 | #define INIT_G() do { \ | ||
118 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ | ||
119 | } while (0) | ||
120 | |||
118 | 121 | ||
119 | /* Must match getopt32 call! */ | 122 | /* Must match getopt32 call! */ |
120 | enum { | 123 | enum { |
@@ -678,9 +681,7 @@ int nc_main(int argc, char **argv) | |||
678 | int x; | 681 | int x; |
679 | unsigned o_lport = 0; | 682 | unsigned o_lport = 0; |
680 | 683 | ||
681 | /* I was in this barbershop quartet in Skokie IL ... */ | 684 | INIT_G(); |
682 | /* round up the usual suspects, i.e. malloc up all the stuff we need */ | ||
683 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); | ||
684 | 685 | ||
685 | /* catch a signal or two for cleanup */ | 686 | /* catch a signal or two for cleanup */ |
686 | bb_signals(0 | 687 | bb_signals(0 |