fix: add missing kqueue init handler

This commit is contained in:
CJ van den Berg 2026-02-26 14:13:17 +01:00
parent 272e35b048
commit 40d784bd9f
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -458,7 +458,7 @@ const KQueueBackend = struct {
const NOTE_ATTRIB: u32 = 0x00000008;
const NOTE_EXTEND: u32 = 0x00000004;
fn init() (std.posix.KQueueError || std.posix.KEventError)!@This() {
fn init(handler: *Handler) (std.posix.KQueueError || std.posix.KEventError)!@This() {
const kq = try std.posix.kqueue();
errdefer std.posix.close(kq);
const pipe = try std.posix.pipe();
@ -477,7 +477,7 @@ const KQueueBackend = struct {
.udata = 0,
};
_ = try std.posix.kevent(kq, &.{shutdown_kev}, &.{}, null);
return .{ .kq = kq, .shutdown_pipe = pipe, .thread = null, .watches = .empty, .snapshots = .empty, .snapshots_mutex = .{} };
return .{ .handler = handler, .kq = kq, .shutdown_pipe = pipe, .thread = null, .watches = .empty, .snapshots = .empty, .snapshots_mutex = .{} };
}
fn deinit(self: *@This(), allocator: std.mem.Allocator) void {