]> Cypherpunks.ru repositories - goredo.git/commitdiff
Serialise stderr writing
authorSergey Matveev <stargrave@stargrave.org>
Sat, 7 Oct 2023 17:30:30 +0000 (20:30 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 7 Oct 2023 17:30:30 +0000 (20:30 +0300)
run.go

diff --git a/run.go b/run.go
index 283ebc9b673b07cdc78f1e164842ac8c07055e8d..037e7bd330433a16fd19f4f80e17e22c4d9e1a95 100644 (file)
--- 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 {