]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
com_term(): Ignore SIGTERM.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 24 Mar 2022 21:06:02 +0000 (22:06 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 3 Oct 2022 20:42:13 +0000 (22:42 +0200)
Just to shut up valgrind when the server terminates due to the term
command.

command.c

index a0102eebe42db14df8bf9893efec500fc56bf6f1..00d2c5a61ada8fdcedfad2989e43844265ca46d5 100644 (file)
--- a/command.c
+++ b/command.c
@@ -630,6 +630,13 @@ EXPORT_SERVER_CMD_HANDLER(ll);
 static int com_term(__a_unused struct command_context *cc,
                __a_unused struct lls_parse_result *lpr)
 {
+       /*
+        * The server catches SIGTERM and propagates this signal to all its
+        * children. We are about to exit anyway, but we'd leak tons of memory
+        * if being terminated by the signal. So we ignore the signal here and
+        * terminate via the normal exit path, deallocating all memory.
+        */
+       para_sigaction(SIGTERM, SIG_IGN);
        kill(getppid(), SIGTERM);
        return 1;
 }