summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-04 11:50:17 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-04 11:50:17 +0200
commit66c2dc7476c4a5105bcf233dd4e08f0466e7f3dc (patch)
tree8b3cae5a66271a3f327467f9e8850e300bafea6a
parent41618d081d650f9cc105034bfa37d3b861663db7 (diff)
Use SIGHUP instead of SIGKILL
This doesn't enforces anymore the brutal termination. Change-Id: I62445c7cb3692354637906fb1ddda1787c8fb82a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 8d1c7d16..cee55969 100644
--- a/src/main.c
+++ b/src/main.c
@@ -99,11 +99,10 @@ static void start_list(struct afb_config_list *list,
+--------------------------------------------------------- */
static void exit_handler()
{
- /* TODO: check whether using SIGHUP isn't better */
if (SELF_PGROUP)
- killpg(0, SIGKILL);
+ killpg(0, SIGHUP);
else if (childpid > 0)
- killpg(childpid, SIGKILL);
+ killpg(childpid, SIGHUP);
}
/*----------------------------------------------------------
@@ -489,7 +488,7 @@ int main(int argc, char *argv[])
}
/* handle groups */
-// atexit(exit_handler);
+ atexit(exit_handler);
/* ignore any SIGPIPE */
signal(SIGPIPE, SIG_IGN);