diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 695a69301982..9d7e66ce2b5b 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -97,7 +97,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; #ifndef PHP_WIN32 /* XXX this will need to change later when threaded fastcgi is implemented. shane */ -struct sigaction act, old_term, old_quit, old_int; +static struct sigaction act, old_term, old_quit, old_int; #endif static void (*php_php_import_environment_variables)(zval *array_ptr); @@ -116,7 +116,7 @@ static int parent = 1; #ifndef PHP_WIN32 /* Did parent received exit signals SIG_TERM/SIG_INT/SIG_QUIT */ -static int exit_signal = 0; +static volatile sig_atomic_t exit_signal = 0; /* Is Parent waiting for children to exit */ static int parent_waiting = 0; @@ -1454,7 +1454,7 @@ static void init_request_info(fcgi_request *request) /** * Clean up child processes upon exit */ -void fastcgi_cleanup(int signal) +static void fastcgi_cleanup(int signal) { #ifdef DEBUG_FASTCGI fprintf(stderr, "FastCGI shutdown, pid %d\n", getpid()); @@ -1468,7 +1468,7 @@ void fastcgi_cleanup(int signal) if (parent && parent_waiting) { exit_signal = 1; } else { - exit(0); + _exit(0); } } #else