diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 2 | ||||
-rw-r--r-- | networking/ifenslave.c | 2 | ||||
-rw-r--r-- | networking/nc_bloaty.c | 9 | ||||
-rw-r--r-- | networking/sendmail.c | 2 | ||||
-rw-r--r-- | networking/traceroute.c | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 5be5317..de84cca 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -322,7 +322,7 @@ struct globals { #define http_error_page (G.http_error_page ) #define proxy (G.proxy ) #define INIT_G() do { \ - PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ USE_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ bind_addr_or_port = "80"; \ file_size = -1; \ diff --git a/networking/ifenslave.c b/networking/ifenslave.c index 774d7c2..76aaa76 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c @@ -129,7 +129,7 @@ struct globals { #define master (G.master ) #define slave (G.slave ) #define INIT_G() do { \ - PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ } while (0) diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index dd62e5d..cd01478 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c @@ -97,7 +97,6 @@ struct globals { }; #define G (*ptr_to_globals) - #define wrote_out (G.wrote_out ) #define wrote_net (G.wrote_net ) #define ouraddr (G.ouraddr ) @@ -115,6 +114,10 @@ struct globals { #else #define o_interval 0 #endif +#define INIT_G() do { \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ +} while (0) + /* Must match getopt32 call! */ enum { @@ -678,9 +681,7 @@ int nc_main(int argc, char **argv) int x; unsigned o_lport = 0; - /* I was in this barbershop quartet in Skokie IL ... */ - /* round up the usual suspects, i.e. malloc up all the stuff we need */ - PTR_TO_GLOBALS = xzalloc(sizeof(G)); + INIT_G(); /* catch a signal or two for cleanup */ bb_signals(0 diff --git a/networking/sendmail.c b/networking/sendmail.c index 3a6078f..eb356dc 100644 --- a/networking/sendmail.c +++ b/networking/sendmail.c @@ -77,7 +77,7 @@ struct globals { #define xargs (G.xargs ) #define fargs (G.fargs ) #define INIT_G() do { \ - PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ xargs[0] = "openssl"; \ xargs[1] = "s_client"; \ xargs[2] = "-quiet"; \ diff --git a/networking/traceroute.c b/networking/traceroute.c index 2ba558f..582840a 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -378,7 +378,7 @@ struct globals { #define wherefrom (G.wherefrom) #define gwlist (G.gwlist ) #define INIT_G() do { \ - PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ + SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ maxpacket = 32 * 1024; \ port = 32768 + 666; \ waittime = 5; \ |