diff options
author | Peter Bex <peter@more-magic.net> | 2018-01-23 21:40:03 +0100 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2018-01-23 21:40:03 +0100 |
commit | a8d26cc7c2af1e61211e9614ce18934a241cbb36 (patch) | |
tree | a50f0cebce06a096f045ede7cc668cea3cddbf2e /scsh-process.scm | |
parent | c9ea3c7427f40f456a589e61529fb12cdb99d9af (diff) | |
download | scsh-process-a8d26cc7c2af1e61211e9614ce18934a241cbb36.tar.gz |
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"
Diffstat (limited to 'scsh-process.scm')
-rw-r--r-- | scsh-process.scm | 7 |
1 files 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))))) |