summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-01 17:44:18 +0100
committerPeter Bex <peter@more-magic.net>2012-10-01 17:44:18 +0100
commitc02fe381318d7d1c8349914124ef0afcd12d331b (patch)
tree3b323f8a220eef90fc774928d32c9f3cc584952c
parent9bd96e97a6c6c7b346738ff3139260805bcb6d89 (diff)
downloadscsh-process-c02fe381318d7d1c8349914124ef0afcd12d331b.tar.gz
Clean up FDs that we don't use anymore
-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))))