commit a84402d7963c08f72e571da7fd0bea2b57aca411 (tree)
parent 132b18e2b39feca3b90b1b13df2b4649b1661fd5
Author: Ryan Liptak <squeek502@hotmail.com>
Date: Wed, 23 Jun 2021 17:22:34 -0700
Add NotDir as possible error for os.inotify_add_watch
Possible when "mask contains IN_ONLYDIR and pathname is not a directory."
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/std/os.zig b/lib/std/os.zig
@@ -3667,6 +3667,7 @@ pub const INotifyAddWatchError = error{
FileNotFound,
SystemResources,
UserResourceLimitReached,
+ NotDir,
} || UnexpectedError;
/// add a watch to an initialized inotify instance
@@ -3690,6 +3691,7 @@ pub fn inotify_add_watchZ(inotify_fd: i32, pathname: [*:0]const u8, mask: u32) I
ENOENT => return error.FileNotFound,
ENOMEM => return error.SystemResources,
ENOSPC => return error.UserResourceLimitReached,
+ ENOTDIR => return error.NotDir,
else => |err| return unexpectedErrno(err),
}
}