Skip to content

cgi: tidy up fastcgi_cleanup signal handler #13026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -1468,7 +1468,7 @@ void fastcgi_cleanup(int signal)
if (parent && parent_waiting) {
exit_signal = 1;
} else {
exit(0);
_exit(0);
}
}
#else
Expand Down