summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-03 00:12:57 +0200
committerPeter Bex <peter@more-magic.net>2012-10-03 00:12:57 +0200
commit0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919 (patch)
tree0f6188a01a3a3f718af6d3383abbb6d2bc487e2e
parent79cf0e254aa94d96027a767bf54230ab67262569 (diff)
downloadscsh-process-0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919.tar.gz
Clean up tempfiles by open/unlink combination in run/collecting*
-rw-r--r--scsh-process.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index b568e94..fde9186 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -115,7 +115,11 @@
;; Documented under http://www.scsh.net/docu/html/man-Z-H-3.html#node_sec_2.4.2
(define (run/collecting* fds thunk)
- (let* ((temp-files (map (lambda (fd) (open-input-file (create-temporary-file)))
+ (let* ((temp-files (map (lambda (fd)
+ (let* ((file-name (create-temporary-file))
+ (port (open-input-file file-name)))
+ (delete-file file-name)
+ port))
fds))
(conns (map (lambda (from-fd temp-file)
(list from-fd (port->fileno temp-file)))