diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-28 10:29:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-28 10:29:17 +0000 |
commit | b9256054419582dc35917b1cb39c7e09f489dfad (patch) | |
tree | 2ce3a816b788b3af5fa54109b765ee22d5550c5e /runit/sv.c | |
parent | c3122bca53255799f052fcc0e911b68237faa12d (diff) |
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.c | 22 |
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 #include "libbb.h" #include "runit_lib.h" -static const char *acts; -static char **service; -static unsigned rc; +struct globals { + const char *acts; + char **service; + unsigned rc; /* "Bernstein" time format: unix + 0x400000000000000aULL */ -static uint64_t tstart, tnow; -static svstatus_t svstatus; + uint64_t tstart, tnow; + svstatus_t svstatus; +}; +#define G (*(struct globals*)&bb_common_bufsiz1) +#define acts (G.acts ) +#define service (G.service ) +#define rc (G.rc ) +#define tstart (G.tstart ) +#define tnow (G.tnow ) +#define svstatus (G.svstatus ) +#define INIT_G() do { } while (0) static void fatal_cannot(const char *m1) ATTRIBUTE_NORETURN; @@ -418,6 +428,8 @@ int sv_main(int argc, char **argv) int (*cbk)(const char*); int curdir; + INIT_G(); + xfunc_error_retval = 100; x = getenv("SVDIR"); |