fix: cli should use the selected watcher interface

This commit is contained in:
CJ van den Berg 2026-03-09 11:37:40 +01:00
parent adc8f81b4f
commit d1864f26fb
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -80,7 +80,7 @@ const CliHandler = struct {
} }
}; };
fn run_linux(watcher: *nightwatch) !void { fn run_linux(watcher: *Watcher) !void {
var fds = [_]std.posix.pollfd{ var fds = [_]std.posix.pollfd{
.{ .fd = watcher.poll_fd(), .events = std.posix.POLL.IN, .revents = 0 }, .{ .fd = watcher.poll_fd(), .events = std.posix.POLL.IN, .revents = 0 },
.{ .fd = sig_pipe[0], .events = std.posix.POLL.IN, .revents = 0 }, .{ .fd = sig_pipe[0], .events = std.posix.POLL.IN, .revents = 0 },
@ -242,7 +242,7 @@ pub fn main() !void {
try stderr.interface.print("on watch: {s}\n", .{path}); try stderr.interface.print("on watch: {s}\n", .{path});
} }
if (nightwatch.Default.interface_type == .polling) { if (Watcher.interface_type == .polling) {
try run_linux(&watcher); try run_linux(&watcher);
} else if (builtin.os.tag == .windows) { } else if (builtin.os.tag == .windows) {
run_windows(); run_windows();