* popen.scm (open-process): after forking, close all ports except
authorGary Houston <ghouston@arglist.com>
Mon, 10 Apr 2000 21:55:53 +0000 (21:55 +0000)
committerGary Houston <ghouston@arglist.com>
Mon, 10 Apr 2000 21:55:53 +0000 (21:55 +0000)
the end of the pipe to the parent.  otherwise move->fdes and
the exec'd program and the exit handlers can interfere with file
descriptors still in use in parent ports.

ice-9/popen.scm

index 35feb74..5689e5f 100644 (file)
@@ -23,9 +23,7 @@
       (cond ((= pid 0)
             ;; child
             (set-batch-mode?! #t)
-            (if reading
-                (close-port (car p))
-                (close-port (cdr p)))
+            (close-all-ports-except (if reading (cdr p) (car p)))
             (move->fdes (if reading (cdr p) (car p))
                         (if reading 1 0))
             (apply execlp prog prog args))