civodul pushed a commit to branch main in repository shepherd. commit 17f44dbd24381ae3dab9b5fe913d404189287416 Author: Ludovic Courtès <l...@gnu.org> AuthorDate: Wed Feb 19 11:21:07 2025 +0100
shepherd: Replace ‘newline’ binding with a suspendable one. * modules/shepherd.scm (main): Add ‘newline’ to the set of replaced core bindings. --- modules/shepherd.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index cc29c53..1a860e9 100644 --- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -25,6 +25,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (ice-9 rdelim) ;; Line-based I/O. + #:use-module ((ice-9 textual-ports) #:select (put-char)) #:use-module ((ice-9 threads) #:select (all-threads)) #:use-module (srfi srfi-1) ;; List library. #:use-module (srfi srfi-26) @@ -561,6 +562,10 @@ fork in the child process." ;; not introduce a continuation barrier. Replace 'sleep' to ;; avoid blocking in user code such as 'start' methods. (replace-core-bindings! + (newline (lambda* (#:optional (port (current-output-port))) + ;; As of Guile 3.0.10, 'newline' is written in C + ;; and thus a continuation barrier. Replace it. + (put-char port #\newline))) (system* (lambda command (spawn-command command))) (system spawn-shell-command)