Commits

Peter Bex committed 9c133ac

Clean up FDs that we don't use anymore

Comments (0)

Files changed (1)

                       ;; Set up linkage from output fds to created pipes.
                       (for-each (lambda (from-fd)
                                   (duplicate-fileno (cadr p) from-fd))
-                                from-fds-for-this-p))
+                                from-fds-for-this-p)
+                      ;; Not needed anymore after duplication is complete.
+                      (file-close (cadr p)))
                     pipe-pairs from-fds)
           (if thunk (thunk) pid))
         (begin                          ; Parent
                       ;; Close sending end in parent.
                       (file-close (cadr p))
                       ;; Set up linkage from created pipes to the input fds.
-                      (duplicate-fileno (car p) to-fd))
+                      (duplicate-fileno (car p) to-fd)
+                      ;; No longer needed after duplication.
+                      (file-close (car p)))
                     pipe-pairs to-fds)
           pid))))