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