From: Matt Birkholz Date: Wed, 9 Oct 2013 23:20:58 +0000 (-0700) Subject: handle-subprocess-status-change: Do not close i/o channels! X-Git-Tag: mit-scheme-pucked-9.2.12~454 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ad21595a269706ee9a8b5bdcf09e1d125afd8f09;p=mit-scheme.git 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. --- 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))