+Related links:
+
+http://bugs.php.net/bug.php?id=41593
+http://bugs.php.net/bug.php?id=36158
+http://php-fpm.anight.org/
+
--- php5.3-200711071330/sapi/cgi/cgi_main.c 2007-11-01 13:32:38.000000000 +0200
+++ php5.3-200711071330-graceful/sapi/cgi/cgi_main.c 2007-11-07 17:40:37.884171760 +0200
@@ -101,6 +101,9 @@
static int parent = 1;
+/* Socket we are listening on incoming connections */
-+static int fcgi_fd = -1;
++static int fcgi_fd = 0;
+
/**
* Process group
*/
-@@ -116,6 +119,7 @@
- static char *php_optarg = NULL;
- static int php_optind = 1;
- static zend_module_entry cgi_module_entry;
-+static int accept_socket = -1;
-
- static const opt_struct OPTIONS[] = {
- {'a', 0, "interactive"},
@@ -1211,16 +1215,38 @@
#endif
+
+ /* Whoever we also close the listeing socket (which PHP itself doesn't seem to do?!) */
+ closesocket(fcgi_fd);
-+ fcgi_fd = -1;
++ fcgi_fd = 0;
+}
+
+