aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c9
-rw-r--r--sd.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/main.c b/main.c
index 4652583..a5f091b 100644
--- a/main.c
+++ b/main.c
@@ -43,11 +43,16 @@ int main(int argc, char **argv) {
setbuf(stdout, NULL);
a_env.pid = getppid();
signal(SIGHUP, SIG_IGN);
- if (sd_setup()) {
+ int r = sd_setup();
+ if (r == -1) {
+ sd_cleanup();
+ return 13;
+ }
+ if (r) {
sd_cleanup();
return main_consent(0);
} else {
- int r = main_consent(1);
+ r = main_consent(1);
sd_cleanup();
return r;
}
diff --git a/sd.c b/sd.c
index c987df3..c9e919b 100644
--- a/sd.c
+++ b/sd.c
@@ -137,7 +137,7 @@ int sd_setup(void) {
}
case SIGINT:
case SIGTERM: {
- exit(13);
+ return -1;
}
default: {
/* Consider insecure.