aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-08 22:07:59 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-08 22:07:59 -0800
commit5c312ec0c92746642958d086c8bf0c0fc8fdf068 (patch)
tree4b25fbb358e3e8342832f1f0f13b3ff47ef1a69b /src
parentbf92c36be1e6c9beaf7f74a1e83f80135b096b0e (diff)
downloadbun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.tar.gz
bun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.tar.zst
bun-5c312ec0c92746642958d086c8bf0c0fc8fdf068.zip
Only perform this check on macOS
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/bun/subprocess.zig22
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