浏览代码

LibCore: Silently ignore IN_IGNORED events

According to the inotify man page, this event is always generated after
a IN_DELETE, which we separately handle. Just ignore IN_IGNORED events
to avoid spamming stderr.
Timothy Flynn 11 月之前
父节点
当前提交
61419cf717
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibCore/FileWatcherLinux.cpp

+ 2 - 0
Userland/Libraries/LibCore/FileWatcherLinux.cpp

@@ -74,6 +74,8 @@ static Optional<FileWatcherEvent> get_event_from_fd(int fd, HashMap<unsigned, By
         result.type |= FileWatcherEvent::Type::ContentModified;
     if ((event->mask & IN_ATTRIB) != 0)
         result.type |= FileWatcherEvent::Type::MetadataModified;
+    if ((event->mask & IN_IGNORED) != 0)
+        return {};
 
     if (result.type == FileWatcherEvent::Type::Invalid) {
         warnln("Unknown event type {:x} returned by the watch_file descriptor for {}", event->mask, path);