diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-05-24 11:58:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-05-27 20:56:48 -0700 |
| commit | 275917345237b79761a0692dbc7d47080cd4c8b5 (patch) | |
| tree | 70a14d1d8238c89142d1f2ec82e2246d04eb2a6b /src/main.zig | |
| parent | 352dc2c06a470d88c33dfbfdf3fdbb093097775c (diff) | |
| download | zig-275917345237b79761a0692dbc7d47080cd4c8b5.tar.gz zig-275917345237b79761a0692dbc7d47080cd4c8b5.zip | |
zig build: lock stderr while executing the build runner
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 3369fa4c21..ac8a483d17 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5151,7 +5151,12 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { child.stdout_behavior = .Inherit; child.stderr_behavior = .Inherit; - const term = try child.spawnAndWait(); + const term = t: { + std.debug.lockStdErr(); + defer std.debug.unlockStdErr(); + break :t try child.spawnAndWait(); + }; + switch (term) { .Exited => |code| { if (code == 0) return cleanExit(); |
