summaryrefslogtreecommitdiff
path: root/scsh-process.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scsh-process.scm')
-rw-r--r--scsh-process.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index 2700640..7350edb 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -117,12 +117,14 @@
;; 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 () (open-input-file (create-temporary-file)))
+ (let* ((temp-files (map (lambda (fd) (open-input-file (create-temporary-file)))
fds))
- (conns (map (lambda (temp-fd from-fd)
- (list from-fd (open-input-file* temp-fd)))
- temp-files fds)))
- (apply values (fork/pipe+ conns thunk) temp-files)))
+ (conns (map (lambda (from-fd temp-file)
+ (list from-fd (port->fileno temp-file)))
+ fds temp-files)))
+ (receive (p s code)
+ (process-wait (fork/pipe+ conns thunk))
+ (apply values code temp-files))))
(define (run/port* thunk)
(receive (in out)