From 27553b91d00fc9a226f82ce6542631c899b61b28 Mon Sep 17 00:00:00 2001 From: Mathieu CARBONNEAUX OSUAGWU Date: Tue, 5 Nov 2024 02:10:52 +0100 Subject: [PATCH] try to fix windows version of cgi-fcgi --- cgi-fcgi/cgi-fcgi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cgi-fcgi/cgi-fcgi.c b/cgi-fcgi/cgi-fcgi.c index b34ca18..558d275 100644 --- a/cgi-fcgi/cgi-fcgi.c +++ b/cgi-fcgi/cgi-fcgi.c @@ -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); @@ -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);