diff options
author | 2022-11-08 22:07:59 -0800 | |
---|---|---|
committer | 2022-11-08 22:07:59 -0800 | |
commit | 5c312ec0c92746642958d086c8bf0c0fc8fdf068 (patch) | |
tree | 4b25fbb358e3e8342832f1f0f13b3ff47ef1a69b | |
parent | bf92c36be1e6c9beaf7f74a1e83f80135b096b0e (diff) | |
download | bun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.tar.gz bun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.tar.zst bun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.zip |
Only perform this check on macOS
-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 |