Skip to content

Commit

Permalink
try to fix windows version of cgi-fcgi
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarbonneaux committed Nov 5, 2024
1 parent 99c1b0a commit 27553b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cgi-fcgi/cgi-fcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,11 @@ int main(int argc, char **argv)
bytesToRead = 0;
}

#ifndef _WIN32
/* Become a process group leader */
setsid();

/* Register our signal handler */
#ifndef _WIN32
signal(SIGHUP, handle_shutdown);
#endif
signal(SIGINT, handle_shutdown);
Expand All @@ -805,13 +805,17 @@ int main(int argc, char **argv)
if(doStart && (!doBind || appServerSock < 0)) {
FCGI_Start(bindPath, appPath, nServers);
if(!doBind) {
#ifndef _WIN32
if(!doDaemon) {
for(pid=nServers; pid != 0; pid--) {
wait(0);
}
}
#endif
signal(SIGTERM, SIG_IGN);
#ifndef _WIN32
kill(0, SIGTERM);
#endif
exit(0);
} else {
appServerSock = OS_FcgiConnect(bindPath);
Expand Down

0 comments on commit 27553b9

Please sign in to comment.