]> granicus.if.org Git - php/commitdiff
- Fixed bug #53527 (php-fpm --test doesn't set a valuable return value).
authorJérôme Loyet <fat@php.net>
Sat, 18 Dec 2010 11:22:11 +0000 (11:22 +0000)
committerJérôme Loyet <fat@php.net>
Sat, 18 Dec 2010 11:22:11 +0000 (11:22 +0000)
NEWS
sapi/fpm/fpm/fpm.c
sapi/fpm/fpm/fpm.h
sapi/fpm/fpm/fpm_conf.c

diff --git a/NEWS b/NEWS
index b51bc350b57cf1f0bff0d128b8ab7f78ecd5f04e..1bafc30453c9262c33bb2e7373ed5db1e6bdb22d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,9 @@
 - Phar Extension:
   . Fixed bug #53541 (format string bug in ext/phar).
     (crrodriguez at opensuse dot org, Ilia)
+
+- PHP-FPM SAPI:
+  . Fixed bug #53527 (php-fpm --test doesn't set a valuable return value). (fat)
     
 - SPL extension:
   . Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0
index 17a215c888cd3d2af381ebe02994f518cbb8f47e..f9d2a75b6d7113b35ff3fee86ac88f70f4f63794 100644 (file)
 #include "fpm_stdio.h"
 #include "zlog.h"
 
-struct fpm_globals_s fpm_globals;
+struct fpm_globals_s fpm_globals = {
+               .parent_pid = 0, 
+               .argc = NULL,
+               .argv = NULL,
+               .config = NULL,
+               .prefix = NULL,
+               .running_children = 0,
+               .error_log_fd = 0,
+               .log_level = 0,
+               .listening_socket = 0,
+               .max_requests = 0,
+               .is_child = 0,
+               .test_successful = 0
+       };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, int test_conf) /* {{{ */
 {
@@ -43,7 +56,12 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, int test_conf) /
                0 > fpm_sockets_init_main()          ||
                0 > fpm_worker_pool_init_main()      ||
                0 > fpm_event_init_main()) {
-               return -1;
+               
+               if (fpm_globals.test_successful) {
+                       exit(0);
+               } else {
+                       return -1;
+               }
        }
 
        if (0 > fpm_conf_write_pid()) {
index 63e3bacca427f29860f9051dffc24fe26d80c9e6..f06d9ed6a91ce8b291679af6cab1b295e44404a9 100644 (file)
@@ -22,6 +22,7 @@ struct fpm_globals_s {
        int listening_socket; /* for this child */
        int max_requests; /* for this child */
        int is_child;
+       int test_successful;
 };
 
 extern struct fpm_globals_s fpm_globals;
index f38227c2f240304a82734f1e151a057de8863ad6..5d6fe770cd92e2bf49b2e5504490f7d598150305 100644 (file)
@@ -1218,6 +1218,7 @@ int fpm_conf_init_main(int test_conf) /* {{{ */
                        fpm_conf_dump();
                }
                zlog(ZLOG_NOTICE, "configuration file %s test is successful\n", fpm_globals.config);
+               fpm_globals.test_successful = 1;
                return -1;
        }