src/lib/https.c 1.2

1.2 2009/09/25 00:21:20 galt
close all extra descriptors to fix fork for mysql5 client
Index: src/lib/https.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/https.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/lib/https.c	10 Mar 2009 00:30:52 -0000	1.1
+++ src/lib/https.c	25 Sep 2009 00:21:20 -0000	1.2
@@ -33,8 +33,14 @@
     fclose(stdout);
 
     close(sv[0]);  /* close unused half of pipe */
 
+    /* close other file descriptors */
+    int fd=0;
+    for (fd = STDERR_FILENO+1; fd < 64; fd++)
+      if (fd != sv[1])
+  	close(fd);
+
     char hostnameProto[256];
 
     BIO *sbio;
     int len;
@@ -149,9 +155,9 @@
 	    errnoAbort("error writing https socket");
 	}
 
     BIO_free_all(sbio);
-    close(sv[1]);  /* being safe */
+    close(sv[1]);  /* we are done with it */
 
     exit(0);
 
     /* child will never get to here */