Merge pull request #119 from mappu/miqt-clang-race-condition

genbindings: fix race condition in clang output pipe
This commit is contained in:
mappu 2025-01-04 11:34:09 +13:00 committed by GitHub
commit c61b1b5e14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,13 +67,15 @@ func clangExec(ctx context.Context, clangBin, inputHeader string, cflags []strin
inner, innerErr = clangStripUpToFile(pr, matcher)
}()
// Go documentation says: only call cmd.Wait once all reads from the
// StdoutPipe have completed
wg.Wait()
err = cmd.Wait()
if err != nil {
return nil, fmt.Errorf("Command: %w", err)
}
wg.Wait()
return inner, innerErr
}