Author: André Düwel
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/1248516
Description: reset file descriptor after closing
 Fixes problem: FastCGI Application occasionally hangs in an infinite loop
 after restarting of Apache.
Forwarded: no

--- libfcgi/os_unix.c
+++ libfcgi/os_unix.c
@@ -1199,6 +1199,7 @@
                     break;
 
                 close(socket);
+                socket = -1;
             }  /* socket >= 0 */
         }  /* for(;;) */
 
