]> TLD Linux GIT Repositories - packages/php.git/commitdiff
- restored missing chunk
authorMarcin Krol <hawk@tld-linux.org>
Tue, 13 Jan 2026 20:06:27 +0000 (21:06 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 13 Jan 2026 20:06:27 +0000 (21:06 +0100)
php-fcgi-graceful.patch

index 50d685b57921ec75201544048cc8eed070256457..cc33f8a714a16ecba58027aaae937546f187ed86 100644 (file)
@@ -18,8 +18,8 @@ while ($i < 35) {
 echo "end!<br>\n";
 ?>
 
---- php-7.1.0alpha2/sapi/cgi/cgi_main.c~       2016-07-04 14:56:49.000000000 +0300
-+++ php-7.1.0alpha2/sapi/cgi/cgi_main.c        2016-07-04 14:58:17.522958766 +0300
+--- php-8.5.1/sapi/cgi/cgi_main.c.orig 2025-12-16 16:59:07.000000000 +0100
++++ php-8.5.1/sapi/cgi/cgi_main.c      2026-01-13 20:40:34.050183839 +0100
 @@ -117,6 +117,9 @@ static int children = 0;
   */
  static int parent = 1;
@@ -30,7 +30,7 @@ echo "end!<br>\n";
  #ifndef PHP_WIN32
  /* Did parent received exit signals SIG_TERM/SIG_INT/SIG_QUIT */
  static volatile sig_atomic_t exit_signal = 0;
-@@ -1221,6 +1224,21 @@
+@@ -1501,6 +1504,21 @@ BOOL WINAPI fastcgi_cleanup(DWORD sig)
  }
  #endif
  
@@ -52,7 +52,7 @@ echo "end!<br>\n";
  PHP_INI_BEGIN()
        STD_PHP_INI_BOOLEAN("cgi.rfc2616_headers",     "0",  PHP_INI_ALL,    OnUpdateBool,   rfc2616_headers, php_cgi_globals_struct, php_cgi_globals)
        STD_PHP_INI_BOOLEAN("cgi.nph",                 "0",  PHP_INI_ALL,    OnUpdateBool,   nph, php_cgi_globals_struct, php_cgi_globals)
-@@ -1764,7 +1764,6 @@
+@@ -1733,7 +1751,6 @@ int main(int argc, char *argv[])
        int requests = 0;
        int fastcgi;
        char *bindpath = NULL;
@@ -60,3 +60,19 @@ echo "end!<br>\n";
        fcgi_request *request = NULL;
        int warmup_repeats = 0;
        int repeats = 1;
+@@ -2044,9 +2061,14 @@ consult the installation file that came
+                                               php_child_init();
+                                               /* don't catch our signals */
+-                                              sigaction(SIGTERM, &old_term, 0);
+                                               sigaction(SIGQUIT, &old_quit, 0);
+                                               sigaction(SIGINT,  &old_int,  0);
++
++                                              /* call graceful shutdown handler for SIGTERM */
++                                              act.sa_flags = 0;
++                                              act.sa_handler = fastcgi_graceful_shutdown;
++                                              sigaction(SIGTERM, &act, &old_term);
++
+                                               zend_signal_init();
+                                               break;
+                                       case -1: