fix(native): address review findings in the hook and the ctl fallback

This commit is contained in:
Kurt Himebauch committed 2026-11-08 15:10:43 -05:00
1 parent e930a4997c
commit 933047e130
11 files changed
+28 -219

No files matched your search

+5 -2
View File
@@ -209,10 +209,13 @@ int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
if (!pathname) return -1;
char buf[PATH_MAX];
const char *target = rewrite_path(pathname, buf, sizeof(buf));
if (target && access(target, F_OK) != 0) {
if (!orig_inotify_add_watch) return -1;
int wd = orig_inotify_add_watch(fd, target, mask);
if (wd < 0 && errno == ENOENT && (mask & IN_ONLYDIR)) {
ensure_dir_exists(target);
wd = orig_inotify_add_watch(fd, target, mask);
}
return orig_inotify_add_watch ? orig_inotify_add_watch(fd, target, mask) : -1;
return wd;
}
// Hook rename