summaryrefslogtreecommitdiff
path: root/scsh-process.scm
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-02 21:34:57 +0200
committerPeter Bex <peter@more-magic.net>2012-10-02 21:34:57 +0200
commit9aad14a928c3a2f8bff2ed9b0b6e13f528645f0b (patch)
tree6fdb657362d33aca75ac7d43feaaca1ccfaa2e4f /scsh-process.scm
parent9e76b49621308e19f93b627d6fdddeb29f466f39 (diff)
downloadscsh-process-9aad14a928c3a2f8bff2ed9b0b6e13f528645f0b.tar.gz
Ensure port is closed before returning from run/sexp*; this would hopefull ensure processes don't hang when they keep writing while the pipe buffer is full. Instead, it would kill the process with sigpipe
Diffstat (limited to 'scsh-process.scm')
-rw-r--r--scsh-process.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index b9ca087..b568e94 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -157,7 +157,10 @@
(define (run/strings* thunk)
(read-lines (run/port* thunk)))
(define (run/sexp* thunk)
- (read (run/port* thunk)))
+ (let* ((p (run/port* thunk))
+ (res (read p)))
+ (close-input-port p)
+ res))
(define (run/sexps* thunk)
(read-file (run/port* thunk)))