Skip to content

Commit

Permalink
process: call waitpid for kqueue to match pidfd behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jan 24, 2025
1 parent aceef3d commit b4f3fd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/watcher/process.zig
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ fn ProcessKqueue(comptime xev: type) type {
c_inner: *xev.Completion,
r: xev.Result,
) xev.CallbackAction {
// Reap the process. We do this because our xev.Process
// docs note that this is the equivalent of calling
// `wait` on a process. The Linux side (pidfd) does this
// automatically since the `waitid` syscall is used.
_ = posix.waitpid(c_inner.op.proc.pid, 0);

return @call(.always_inline, cb, .{
common.userdataValue(Userdata, ud),
l_inner,
Expand Down

0 comments on commit b4f3fd8

Please sign in to comment.