diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-27 18:41:59 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-27 18:41:59 +0000 |
commit | 574f2f43948bb21d6e4187936ba5a5afccba25f6 (patch) | |
tree | 0b39aca564149e5ad30b3cc791228655ff1b1827 /networking | |
parent | fe66a0eca1bfeae0abc0fc1e7d3709f271e05e82 (diff) | |
download | busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.tar.gz busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.tar.bz2 busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.zip |
*: add optimization barrier to all "G trick" locations
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 5be53179f..de84ccaa2 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -322,7 +322,7 @@ struct globals { | |||
322 | #define http_error_page (G.http_error_page ) | 322 | #define http_error_page (G.http_error_page ) |
323 | #define proxy (G.proxy ) | 323 | #define proxy (G.proxy ) |
324 | #define INIT_G() do { \ | 324 | #define INIT_G() do { \ |
325 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ | 325 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
326 | USE_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ | 326 | USE_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ |
327 | bind_addr_or_port = "80"; \ | 327 | bind_addr_or_port = "80"; \ |
328 | file_size = -1; \ | 328 | file_size = -1; \ |
diff --git a/networking/ifenslave.c b/networking/ifenslave.c index 774d7c2d2..76aaa7614 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c | |||
@@ -129,7 +129,7 @@ struct globals { | |||
129 | #define master (G.master ) | 129 | #define master (G.master ) |
130 | #define slave (G.slave ) | 130 | #define slave (G.slave ) |
131 | #define INIT_G() do { \ | 131 | #define INIT_G() do { \ |
132 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ | 132 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
133 | } while (0) | 133 | } while (0) |
134 | 134 | ||
135 | 135 | ||
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 |
diff --git a/networking/sendmail.c b/networking/sendmail.c index 3a6078f79..eb356dcf5 100644 --- a/networking/sendmail.c +++ b/networking/sendmail.c | |||
@@ -77,7 +77,7 @@ struct globals { | |||
77 | #define xargs (G.xargs ) | 77 | #define xargs (G.xargs ) |
78 | #define fargs (G.fargs ) | 78 | #define fargs (G.fargs ) |
79 | #define INIT_G() do { \ | 79 | #define INIT_G() do { \ |
80 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ | 80 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
81 | xargs[0] = "openssl"; \ | 81 | xargs[0] = "openssl"; \ |
82 | xargs[1] = "s_client"; \ | 82 | xargs[1] = "s_client"; \ |
83 | xargs[2] = "-quiet"; \ | 83 | xargs[2] = "-quiet"; \ |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 2ba558fc2..582840af6 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -378,7 +378,7 @@ struct globals { | |||
378 | #define wherefrom (G.wherefrom) | 378 | #define wherefrom (G.wherefrom) |
379 | #define gwlist (G.gwlist ) | 379 | #define gwlist (G.gwlist ) |
380 | #define INIT_G() do { \ | 380 | #define INIT_G() do { \ |
381 | PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ | 381 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
382 | maxpacket = 32 * 1024; \ | 382 | maxpacket = 32 * 1024; \ |
383 | port = 32768 + 666; \ | 383 | port = 32768 + 666; \ |
384 | waittime = 5; \ | 384 | waittime = 5; \ |