diff options
author | Peter Bex <peter@more-magic.net> | 2012-10-03 00:12:57 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2012-10-03 00:12:57 +0200 |
commit | 0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919 (patch) | |
tree | 0f6188a01a3a3f718af6d3383abbb6d2bc487e2e /scsh-process.scm | |
parent | 79cf0e254aa94d96027a767bf54230ab67262569 (diff) | |
download | scsh-process-0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919.tar.gz |
Clean up tempfiles by open/unlink combination in run/collecting*
Diffstat (limited to 'scsh-process.scm')
-rw-r--r-- | scsh-process.scm | 6 |
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))) |