From d931787e2e40ff2ecd924e2af3e093295d07bddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 1 Sep 2017 13:54:15 +0300 Subject: [PATCH] Use _exit when daemonizing the process The original process should use _exit if the forking of the child process is successful. This makes sure that the exit handlers are called only when the daemon process exits. --- server/core/gateway.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/gateway.cc b/server/core/gateway.cc index b0fd95225..9ee541bbf 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -1704,7 +1704,7 @@ int main(int argc, char **argv) exit(MAXSCALE_INTERNALERROR); } - exit(child_status); + _exit(child_status); } /** This is the child process and we can close the read end of