aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/api/bun/subprocess.zig2
-rw-r--r--src/bun.js/base.zig11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig
index d803704f3..d4fc06e2d 100644
--- a/src/bun.js/api/bun/subprocess.zig
+++ b/src/bun.js/api/bun/subprocess.zig
@@ -1320,7 +1320,7 @@ pub const Subprocess = struct {
)) {
.result => {},
.err => |err| {
- if (err.getErrno() == .SRCH) {
+ if (err.getErrno() != .SRCH) {
@panic("This shouldn't happen");
}
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig
index dc0b98e61..87ace2c54 100644
--- a/src/bun.js/base.zig
+++ b/src/bun.js/base.zig
@@ -3656,7 +3656,9 @@ pub const FilePoll = struct {
1,
// The same array may be used for the changelist and eventlist.
&changelist,
- 1,
+ // we set 0 here so that if we get an error on
+ // registration, it becomes errno
+ 0,
KEVENT_FLAG_ERROR_EVENTS,
&timeout,
);
@@ -3679,10 +3681,9 @@ pub const FilePoll = struct {
const errno = std.c.getErrno(rc);
if (errno != .SUCCESS) {
- switch (rc) {
- std.math.minInt(@TypeOf(rc))...-1 => return JSC.Maybe(void).errnoSys(@enumToInt(errno), .kevent).?,
- else => unreachable,
- }
+ return JSC.Maybe(void){
+ .err = JSC.Node.Syscall.Error.fromCode(errno, .kqueue),
+ };
}
} else {
@compileError("TODO: Pollable");