Commit:    e052da3a6bc353636fa4bf9cb488573c50adf9a0
Author:    Jerome Loyet <f...@php.net>         Sat, 26 May 2012 18:48:40 +0200
Parents:   decc394a2089b955a175aed0091044d0fc3d1aab
Branches:  PHP-5.4

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=e052da3a6bc353636fa4bf9cb488573c50adf9a0

Log:
Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an 
error occured)

Bugs:
https://bugs.php.net/62033

Changed paths:
  M  sapi/fpm/fpm/fpm.c
  M  sapi/fpm/fpm/fpm.h
  M  sapi/fpm/fpm/fpm_main.c
  M  sapi/fpm/fpm/fpm_unix.c


Diff:
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 176dbaf..dab415d 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -39,6 +39,7 @@ struct fpm_globals_s fpm_globals = {
        .test_successful = 0,
        .heartbeat = 0,
        .run_as_root = 0,
+       .send_config_signal = 0,
 };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int 
test_conf, int run_as_root) /* {{{ */
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index b0bed0a..7a2903d 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -55,6 +55,7 @@ struct fpm_globals_s {
        int test_successful;
        int heartbeat;
        int run_as_root;
+       int send_config_signal;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index c3fd2bc..83b461b 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1799,14 +1799,14 @@ consult the installation file that came with this 
distribution, or visit \n\
 
        if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : 
CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 
-               if (fpm_global_config.daemonize) {
+               if (fpm_globals.send_config_signal) {
                        zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent 
%d", getppid());
                        kill(getppid(), SIGUSR2);
                }
                return FPM_EXIT_CONFIG;
        }
 
-       if (fpm_global_config.daemonize) {
+       if (fpm_globals.send_config_signal) {
                zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", 
getppid());
                kill(getppid(), SIGUSR1);
        }
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 0f4d383..5c5e37c 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -305,6 +305,7 @@ int fpm_unix_init_main() /* {{{ */
                                /* restore USR1 and USR2 sigaction */
                                sigaction(SIGUSR1, &oldact_usr1, NULL);
                                sigaction(SIGUSR2, &oldact_usr2, NULL);
+                               fpm_globals.send_config_signal = 1;
                                break;
 
                        default : /* parent */


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to