From c02fe381318d7d1c8349914124ef0afcd12d331b Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 1 Oct 2012 17:44:18 +0100 Subject: Clean up FDs that we don't use anymore --- scsh-process.scm | 8 ++++++-- 1 file 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)))) -- cgit v1.2.3