FCGI::Stream::READ()
[catagits/fcgi2.git] / cgi-fcgi / cgi-fcgi.c
index e04bb22..e0f304a 100644 (file)
@@ -11,7 +11,7 @@
  *
  */
 #ifndef lint
-static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.13 2001/06/22 14:21:34 robs Exp $";
+static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.16 2003/06/22 02:02:33 robs Exp $";
 #endif /* not lint */
 
 #include <assert.h>
@@ -21,7 +21,6 @@ static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.13 2001/06/22 14:21:34 robs Exp
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <io.h>
 
 #include "fcgi_config.h"
 
@@ -31,6 +30,7 @@ static const char rcsid[] = "$Id: cgi-fcgi.c,v 1.13 2001/06/22 14:21:34 robs Exp
 
 #ifdef _WIN32
 #include <stdlib.h>
+#include <io.h>
 #else
 extern char **environ;
 #endif
@@ -43,7 +43,7 @@ extern char **environ;
 #include <sys/time.h>
 #endif
 
-#if defined HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
@@ -188,7 +188,7 @@ static int stdinFds[3];
 static void FCGIexit(int exitCode)
 {
     if(appServerSock != -1) {
-        OS_Close(appServerSock);
+        OS_Close(appServerSock, TRUE);
        appServerSock = -1;
     }
     OS_LibShutdown();
@@ -232,7 +232,7 @@ static void AppServerReadHandler(ClientData dc, int bytesRead)
             exit(FCGX_PROTOCOL_ERROR);
         }
        if(appServerSock != -1) {
-           OS_Close(appServerSock);
+           OS_Close(appServerSock, TRUE);
            appServerSock = -1;
        }
         /*
@@ -531,7 +531,7 @@ static void FCGI_Start(char *bindPath, char *appPath, int nServers)
             exit(OS_Errno);
        }
     }
-    OS_Close(listenFd);
+    OS_Close(listenFd, TRUE);
 }
 \f
 /*