summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scsh-process.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index 7d33f73..87f378f 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -48,7 +48,9 @@
;; 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
@@ -56,7 +58,9 @@
;; 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))))