# std.process.Child: prevent racing children from inheriting one another's pipes · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/88146ea704f2b596b0bec0ab2aba786fcb636d8c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 88146ea704f2b596b0bec0ab2aba786fcb636d8c

Requested commit: 88146ea704f2b596b0bec0ab2aba786fcb636d8c

Commit: 88146ea704f2b596b0bec0ab2aba786fcb636d8c

Tree: 11ab8f2d6d9638f3d91070cd0d6842451f8b3250

Author: Matthew Lugg

Committer: Andrew Kelley

## Message

```
std.process.Child: prevent racing children from inheriting one another's pipes

The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the `poll`
call in `std.Build.Step.evalZigProcess` was not identifying the child
stdout as closed until an unrelated process terminated.

```

## Parents

- [6e469bc44d06037330c63d81f48904f37112f220](https://git.cafe/gitcafe/zig/commit/6e469bc44d06037330c63d81f48904f37112f220?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/88146ea704f2b596b0bec0ab2aba786fcb636d8c?format=markdown)
