| ... | @@ -416,10 +416,12 @@ pub fn main() !void { | ... | @@ -416,10 +416,12 @@ pub fn main() !void { |
| 416 | const reaction_set = rs: { | 416 | const reaction_set = rs: { |
| 417 | const gop = try w.dir_table.getOrPut(gpa, path); | 417 | const gop = try w.dir_table.getOrPut(gpa, path); |
| 418 | if (!gop.found_existing) { | 418 | if (!gop.found_existing) { |
| 419 | try std.posix.fanotify_mark(w.fan_fd, .{ | 419 | std.posix.fanotify_mark(w.fan_fd, .{ |
| 420 | .ADD = true, | 420 | .ADD = true, |
| 421 | .ONLYDIR = true, | 421 | .ONLYDIR = true, |
| 422 | }, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOpt()); | 422 | }, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOpt()) catch |err| { |
| | 423 | fatal("unable to watch {}: {s}", .{ path, @errorName(err) }); |
| | 424 | }; |
| 423 | | 425 | |
| 424 | const dir_handle = try Watch.getDirHandle(gpa, path); | 426 | const dir_handle = try Watch.getDirHandle(gpa, path); |
| 425 | try w.handle_table.putNoClobber(gpa, dir_handle, .{}); | 427 | try w.handle_table.putNoClobber(gpa, dir_handle, .{}); |
| ... | @@ -489,7 +491,7 @@ pub fn main() !void { | ... | @@ -489,7 +491,7 @@ pub fn main() !void { |
| 489 | .revents = undefined, | 491 | .revents = undefined, |
| 490 | }, | 492 | }, |
| 491 | }; | 493 | }; |
| 492 | var caption_buf: [40]u8 = undefined; | 494 | var caption_buf: [std.Progress.Node.max_name_len]u8 = undefined; |
| 493 | const caption = std.fmt.bufPrint(&caption_buf, "Watching {d} Directories", .{ | 495 | const caption = std.fmt.bufPrint(&caption_buf, "Watching {d} Directories", .{ |
| 494 | w.dir_table.entries.len, | 496 | w.dir_table.entries.len, |
| 495 | }) catch &caption_buf; | 497 | }) catch &caption_buf; |