From ef0feea55f4544f8b76992eca6311e348f0add65 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 7 Oct 2023 20:30:30 +0300 Subject: [PATCH] Serialise stderr writing --- run.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run.go b/run.go index 283ebc9..037e7bd 100644 --- a/run.go +++ b/run.go @@ -628,7 +628,9 @@ func runScript(tgt *Tgt, errs chan error, forced, traced bool) error { line = scanner.Text() if strings.HasPrefix(line, childStderrPrefix) { line = line[len(childStderrPrefix):] + LogMutex.Lock() os.Stderr.WriteString(StderrPrefix + line + "\n") + LogMutex.Unlock() continue } if fdStderr != nil { -- 2.44.0