build runner: don't pass a dirfd + null to fanotify_mark
Otherwise it reports EBADF.
This commit is contained in:
@@ -419,7 +419,7 @@ pub fn main() !void {
|
||||
std.posix.fanotify_mark(w.fan_fd, .{
|
||||
.ADD = true,
|
||||
.ONLYDIR = true,
|
||||
}, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOpt()) catch |err| {
|
||||
}, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOrDot()) catch |err| {
|
||||
fatal("unable to watch {}: {s}", .{ path, @errorName(err) });
|
||||
};
|
||||
|
||||
@@ -471,7 +471,7 @@ pub fn main() !void {
|
||||
try std.posix.fanotify_mark(w.fan_fd, .{
|
||||
.REMOVE = true,
|
||||
.ONLYDIR = true,
|
||||
}, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOpt());
|
||||
}, Watch.fan_mask, path.root_dir.handle.fd, path.subPathOrDot());
|
||||
|
||||
w.dir_table.swapRemoveAt(i);
|
||||
w.handle_table.swapRemoveAt(i);
|
||||
|
||||
@@ -173,6 +173,10 @@ pub fn subPathOpt(self: Path) ?[]const u8 {
|
||||
return if (self.sub_path.len == 0) null else self.sub_path;
|
||||
}
|
||||
|
||||
pub fn subPathOrDot(self: Path) []const u8 {
|
||||
return if (self.sub_path.len == 0) "." else self.sub_path;
|
||||
}
|
||||
|
||||
/// Useful to make `Path` a key in `std.ArrayHashMap`.
|
||||
pub const TableAdapter = struct {
|
||||
pub const Hash = std.hash.Wyhash;
|
||||
|
||||
Reference in New Issue
Block a user