From ad21595a269706ee9a8b5bdcf09e1d125afd8f09 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 9 Oct 2013 16:20:58 -0700 Subject: [PATCH] handle-subprocess-status-change: Do not close i/o channels! On Unix subprocess i/o channels need only be closed by subprocess- delete or the GC. Otherwise subprocess termination can close them before their readers/writers can drain them, resulting in truncated output. --- src/runtime/process.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/runtime/process.scm b/src/runtime/process.scm index bc7b81c4e..6432ae936 100644 --- a/src/runtime/process.scm +++ b/src/runtime/process.scm @@ -277,12 +277,13 @@ USA. (let ((latest-tick (subprocess-global-status-tick))) (if (not (eq? latest-tick last-global-tick)) (begin - (for-each (lambda (process) - (if (memq (subprocess-status process) '(EXITED SIGNALLED)) - (close-subprocess-i/o process))) - (subprocess-list)) (signal-subprocess-status-change) - (set! last-global-tick latest-tick))))) + (set! last-global-tick latest-tick)))) + (if (eq? 'NT microcode-id/operating-system) + (for-each (lambda (process) + (if (memq (subprocess-status process) '(EXITED SIGNALLED)) + (close-subprocess-i/o process))) + (subprocess-list)))) (define-integrable subprocess-job-control-available? (ucode-primitive os-job-control? 0)) -- 2.25.1