From 9aad14a928c3a2f8bff2ed9b0b6e13f528645f0b Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 2 Oct 2012 21:34:57 +0200 Subject: 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 --- scsh-process.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scsh-process.scm') 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))) -- cgit v1.2.3