]> git.mxchange.org Git - friendica.git/commitdiff
Register shutdown function as anonymous function
authorArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:31:36 +0000 (09:31 +0000)
committerArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:31:36 +0000 (09:31 +0000)
bin/daemon.php

index 40297b358910432480a5a3e6528d95714a296a3a..d8e47e78c52e84412d3e56a26e4c2ed2463292ef 100755 (executable)
@@ -153,7 +153,10 @@ if (!$foreground) {
        }
 
        // We now are in the child process
-       register_shutdown_function('shutdown');
+       register_shutdown_function(function () {
+               posix_kill(posix_getpid(), SIGTERM);
+               posix_kill(posix_getpid(), SIGHUP);
+       });
 
        // Make the child the main process, detach it from the terminal
        if (posix_setsid() < 0) {
@@ -232,8 +235,3 @@ while (true) {
        }
 }
 })($dice, $options);
-
-function shutdown() {
-       posix_kill(posix_getpid(), SIGTERM);
-       posix_kill(posix_getpid(), SIGHUP);
-}