diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig index 17c453cba60790..5695c15ad6a0af 100644 --- a/src/bun.js/api/bun/subprocess.zig +++ b/src/bun.js/api/bun/subprocess.zig @@ -1718,7 +1718,7 @@ pub const Subprocess = struct { this.waitpid_err = err; }, .result => |result| { - if (result.pid == pid) { + if (result.pid != 0) { if (std.os.W.IFEXITED(result.status)) { this.exit_code = @as(u8, @truncate(std.os.W.EXITSTATUS(result.status))); }