[Commit] nickle file.c,1.55,1.56

Keith Packard commit at keithp.com
Mon Oct 13 12:44:27 PDT 2003


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv8222

Modified Files:
	file.c 
Log Message:
close errpipe on fork failure in FileFilter

Index: file.c
===================================================================
RCS file: /local/src/CVS/nickle/file.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- file.c	13 Oct 2003 18:14:51 -0000	1.55
+++ file.c	13 Oct 2003 18:44:24 -0000	1.56
@@ -806,6 +806,8 @@
     }
     pid = fork ();
     if (pid == -1) {
+	close (errpipe[0]);
+	close (errpipe[1]);
 	*errp = errno;
 	RETURN (0);
     }
@@ -826,13 +828,12 @@
     /* parent */
     close (errpipe[1]);
     nread = read(errpipe[0], &errcode, 1);
+    close (errpipe[0]);
     if (nread != 0) {
 	*errp = errcode;
 	assert (nread == 1);
-	close (errpipe[0]);
 	RETURN(0);
     }
-    close (errpipe[0]);
     for (i = 0; i < 3; i++) {
 	Value f = BoxValue (filev->array.values, i);
 	if (f->file.flags & FilePipe)




More information about the Commit mailing list