aboutsummaryrefslogtreecommitdiff
path: root/runit/sv.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-09-28 10:29:17 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-09-28 10:29:17 +0000
commitb9256054419582dc35917b1cb39c7e09f489dfad (patch)
tree2ce3a816b788b3af5fa54109b765ee22d5550c5e /runit/sv.c
parentc3122bca53255799f052fcc0e911b68237faa12d (diff)
downloadbusybox-w32-b9256054419582dc35917b1cb39c7e09f489dfad.tar.gz
busybox-w32-b9256054419582dc35917b1cb39c7e09f489dfad.tar.bz2
busybox-w32-b9256054419582dc35917b1cb39c7e09f489dfad.zip
assorted static vars removal
function old new delta tcpudpsvd_main 1829 1839 +10 update_status 567 569 +2 sigterm 1 - -1 ......... dhcprelay_signal_handler 8 - -8 nfs_strerror 60 49 -11 singlemount 4579 4564 -15 static.p 16 - -16 svstatus 20 - -20 dhcprelay_xid_list 32 - -32 runsv_main 1785 1746 -39 static.buf 74 28 -46 svd 56 - -56 dhcprelay_main 1141 1080 -61 ------------------------------------------------------------------------------ (add/remove: 0/20 grow/shrink: 2/10 up/down: 12/-386) Total: -374 bytes
Diffstat (limited to 'runit/sv.c')
-rw-r--r--runit/sv.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/runit/sv.c b/runit/sv.c
index 7283bbf7d..757391a54 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -158,12 +158,22 @@ Exit Codes
158#include "libbb.h" 158#include "libbb.h"
159#include "runit_lib.h" 159#include "runit_lib.h"
160 160
161static const char *acts; 161struct globals {
162static char **service; 162 const char *acts;
163static unsigned rc; 163 char **service;
164 unsigned rc;
164/* "Bernstein" time format: unix + 0x400000000000000aULL */ 165/* "Bernstein" time format: unix + 0x400000000000000aULL */
165static uint64_t tstart, tnow; 166 uint64_t tstart, tnow;
166static svstatus_t svstatus; 167 svstatus_t svstatus;
168};
169#define G (*(struct globals*)&bb_common_bufsiz1)
170#define acts (G.acts )
171#define service (G.service )
172#define rc (G.rc )
173#define tstart (G.tstart )
174#define tnow (G.tnow )
175#define svstatus (G.svstatus )
176#define INIT_G() do { } while (0)
167 177
168 178
169static void fatal_cannot(const char *m1) ATTRIBUTE_NORETURN; 179static void fatal_cannot(const char *m1) ATTRIBUTE_NORETURN;
@@ -418,6 +428,8 @@ int sv_main(int argc, char **argv)
418 int (*cbk)(const char*); 428 int (*cbk)(const char*);
419 int curdir; 429 int curdir;
420 430
431 INIT_G();
432
421 xfunc_error_retval = 100; 433 xfunc_error_retval = 100;
422 434
423 x = getenv("SVDIR"); 435 x = getenv("SVDIR");