diff --git a/src/watcher/process.zig b/src/watcher/process.zig index 8112a50..eb4f39a 100644 --- a/src/watcher/process.zig +++ b/src/watcher/process.zig @@ -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,