diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bun.js/api/bun/subprocess.zig | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig index 1eba6acf6..b3fafd450 100644 --- a/src/bun.js/api/bun/subprocess.zig +++ b/src/bun.js/api/bun/subprocess.zig @@ -514,14 +514,20 @@ pub const Subprocess = struct { return; } - // INTR is returned on macOS when the process is killed - // It probably sent SIGPIPE but we have the handler for - // that disabled. - // We know it's the "real" INTR because we use read$NOCANCEL - if (e.getErrno() == .INTR) { - this.received_eof = true; - this.autoCloseFileDescriptor(); - return; + if (comptime Environment.isMac) { + // INTR is returned on macOS when the process is killed + // It probably sent SIGPIPE but we have the handler for + // that disabled. + // We know it's the "real" INTR because we use read$NOCANCEL + if (e.getErrno() == .INTR) { + this.received_eof = true; + this.autoCloseFileDescriptor(); + return; + } + } else { + if (comptime Environment.allow_assert) { + std.debug.assert(e.getErrno() != .INTR); // Bun's read() function should retry on EINTR + } } // fail |