| ... | @@ -99,7 +99,8 @@ const Os = switch (builtin.os.tag) { | ... | @@ -99,7 +99,8 @@ const Os = switch (builtin.os.tag) { |
| 99 | }; | 99 | }; |
| 100 | }; | 100 | }; |
| 101 | | 101 | |
| 102 | fn init() !Watch { | 102 | fn init(cwd_path: []const u8) !Watch { |
| | 103 | _ = cwd_path; |
| 103 | return .{ | 104 | return .{ |
| 104 | .dir_table = .{}, | 105 | .dir_table = .{}, |
| 105 | .dir_count = 0, | 106 | .dir_count = 0, |
| ... | @@ -427,7 +428,8 @@ const Os = switch (builtin.os.tag) { | ... | @@ -427,7 +428,8 @@ const Os = switch (builtin.os.tag) { |
| 427 | } | 428 | } |
| 428 | }; | 429 | }; |
| 429 | | 430 | |
| 430 | fn init() !Watch { | 431 | fn init(cwd_path: []const u8) !Watch { |
| | 432 | _ = cwd_path; |
| 431 | return .{ | 433 | return .{ |
| 432 | .dir_table = .{}, | 434 | .dir_table = .{}, |
| 433 | .dir_count = 0, | 435 | .dir_count = 0, |
| ... | @@ -658,14 +660,13 @@ const Os = switch (builtin.os.tag) { | ... | @@ -658,14 +660,13 @@ const Os = switch (builtin.os.tag) { |
| 658 | const EV = std.c.EV; | 660 | const EV = std.c.EV; |
| 659 | const NOTE = std.c.NOTE; | 661 | const NOTE = std.c.NOTE; |
| 660 | | 662 | |
| 661 | fn init() !Watch { | 663 | fn init(cwd_path: []const u8) !Watch { |
| 662 | const kq_fd = try posix.kqueue(); | 664 | _ = cwd_path; |
| 663 | errdefer posix.close(kq_fd); | | |
| 664 | return .{ | 665 | return .{ |
| 665 | .dir_table = .{}, | 666 | .dir_table = .{}, |
| 666 | .dir_count = 0, | 667 | .dir_count = 0, |
| 667 | .os = .{ | 668 | .os = .{ |
| 668 | .kq_fd = kq_fd, | 669 | .kq_fd = try posix.kqueue(), |
| 669 | .handles = .empty, | 670 | .handles = .empty, |
| 670 | }, | 671 | }, |
| 671 | .generation = 0, | 672 | .generation = 0, |
| ... | @@ -841,9 +842,9 @@ const Os = switch (builtin.os.tag) { | ... | @@ -841,9 +842,9 @@ const Os = switch (builtin.os.tag) { |
| 841 | .macos => struct { | 842 | .macos => struct { |
| 842 | fse: FsEvents, | 843 | fse: FsEvents, |
| 843 | | 844 | |
| 844 | fn init() !Watch { | 845 | fn init(cwd_path: []const u8) !Watch { |
| 845 | return .{ | 846 | return .{ |
| 846 | .os = .{ .fse = try .init() }, | 847 | .os = .{ .fse = try .init(cwd_path) }, |
| 847 | .dir_count = 0, | 848 | .dir_count = 0, |
| 848 | .dir_table = undefined, | 849 | .dir_table = undefined, |
| 849 | .generation = undefined, | 850 | .generation = undefined, |
| ... | @@ -863,8 +864,8 @@ const Os = switch (builtin.os.tag) { | ... | @@ -863,8 +864,8 @@ const Os = switch (builtin.os.tag) { |
| 863 | else => void, | 864 | else => void, |
| 864 | }; | 865 | }; |
| 865 | | 866 | |
| 866 | pub fn init() !Watch { | 867 | pub fn init(cwd_path: []const u8) !Watch { |
| 867 | return Os.init(); | 868 | return Os.init(cwd_path); |
| 868 | } | 869 | } |
| 869 | | 870 | |
| 870 | pub const Match = struct { | 871 | pub const Match = struct { |