mirror of
https://github.com/ziglang/zig.git
synced 2025-02-10 22:50:18 +00:00
std.ChildProcess.spawn: handle 0 from waitpid correctly
This commit is contained in:
parent
838d52a8be
commit
2c8ff1d47b
@ -340,6 +340,9 @@ extern fn sigchld_handler(_: i32) {
|
||||
while (true) {
|
||||
var status: i32 = undefined;
|
||||
const pid_result = posix.waitpid(-1, &status, posix.WNOHANG);
|
||||
if (pid_result == 0) {
|
||||
return;
|
||||
}
|
||||
const err = posix.getErrno(pid_result);
|
||||
if (err > 0) {
|
||||
if (err == posix.ECHILD) {
|
||||
|
Loading…
Reference in New Issue
Block a user