From a8d26cc7c2af1e61211e9614ce18934a241cbb36 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 23 Jan 2018 21:40:03 +0100 Subject: Do not connect stdin to subprocess' stdout in run/file This would cause the REPL to exit after calling (run/file ...) because it reached EOF. Strangely this didn't cause any issues in the tests. Still not sure why this would be the case. Reported by Diego "dieggsy" --- scsh-process.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scsh-process.scm b/scsh-process.scm index 60b9fab..88404a9 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -11,7 +11,7 @@ ;; WARNING: Don't mix with threading unless you're using ;; Chicken 4.8.1 rev 47b5be71 or later. ;; -;;; Copyright (c) 2012-2017, Peter Bex +;;; Copyright (c) 2012-2018, Peter Bex ;; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without @@ -340,9 +340,8 @@ (open-input-file* in))) (define (run/file* thunk) - (let* ((temp-file (create-temporary-file))) - (wait ; This is peculiar - (fork/pipe (lambda () + (let ((temp-file (create-temporary-file))) + (wait (fork (lambda () (let ((fd (file-open temp-file open/wronly))) (duplicate-fileno fd 1) (with-output-to-port (open-output-file* 1) thunk))))) -- cgit v1.2.3