]> granicus.if.org Git - php/commitdiff
fetch fd correctly in fastcgi case
authorSascha Schumann <sas@php.net>
Tue, 2 Sep 2003 16:16:12 +0000 (16:16 +0000)
committerSascha Schumann <sas@php.net>
Tue, 2 Sep 2003 16:16:12 +0000 (16:16 +0000)
sapi/cgi/cgi_main.c

index cf1ef83e47df2f41c57693b7520c61d738524b2a..7a9bc5198c9dd4750fcdeb690e542b5a808bd939 100644 (file)
@@ -491,8 +491,16 @@ static int php_cgi_startup(sapi_module_struct *sapi_module)
 
 static int sapi_cgi_get_fd(int *fd TSRMLS_DC)
 {
+#if PHP_FASTCGI
+       FCGX_Request *request = (FCGX_Request *)SG(server_context);
+       
+       *fd = request->ipcFd;
+       if (*fd >= 0) return SUCCESS;
+       return FAILURE;
+#else
        *fd = STDOUT_FILENO;
        return SUCCESS;
+#endif
 }
 
 static int sapi_cgi_force_http_10(TSRMLS_D)