From b9be78070569e69960ba2b3c4098c3dc3316b9bd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 6 Aug 2017 21:23:03 +0200 Subject: sv,svc: fix NOEXEC fallout function old new delta svc_main 145 162 +17 sv 1280 1297 +17 status 139 133 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-6) Total: 28 bytes Signed-off-by: Denys Vlasenko --- runit/sv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'runit') diff --git a/runit/sv.c b/runit/sv.c index 0817ab472..630f1f37e 100644 --- a/runit/sv.c +++ b/runit/sv.c @@ -193,7 +193,7 @@ struct globals { /* "Bernstein" time format: unix + 0x400000000000000aULL */ uint64_t tstart, tnow; svstatus_t svstatus; - unsigned islog; + smallint islog; } FIX_ALIASING; #define G (*(struct globals*)bb_common_bufsiz1) #define acts (G.acts ) @@ -203,7 +203,13 @@ struct globals { #define tnow (G.tnow ) #define svstatus (G.svstatus ) #define islog (G.islog ) -#define INIT_G() do { setup_common_bufsiz(); } while (0) +#define INIT_G() do { \ + setup_common_bufsiz(); \ + /* need to zero out, we are NOEXEC */ \ + rc = EXIT_SUCCESS; \ + islog = 0; \ + /* other fields need not be zero */ \ +} while (0) #define str_equal(s,t) (strcmp((s), (t)) == 0) -- cgit v1.2.3