mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibCore: Remove monitored file data before invoking system calls
The monitored files can be internally removed by inotify. If we then try to explicitly remove them, the inotify_rm_watch call will fail. We do this when the file is deleted and we receive an IN_DELETE event. This ensures we clean up the monitored files.
This commit is contained in:
parent
61419cf717
commit
abc462999e
Notes:
github-actions[bot]
2024-08-25 07:49:10 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/abc462999e4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1182
1 changed files with 3 additions and 3 deletions
|
@ -164,12 +164,12 @@ ErrorOr<bool> FileWatcherBase::remove_watch(ByteString path)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (::inotify_rm_watch(m_watcher_fd, it->value) < 0)
|
||||
return Error::from_errno(errno);
|
||||
|
||||
m_path_to_wd.remove(it);
|
||||
m_wd_to_path.remove(it->value);
|
||||
|
||||
if (::inotify_rm_watch(m_watcher_fd, it->value) < 0)
|
||||
return Error::from_errno(errno);
|
||||
|
||||
dbgln_if(FILE_WATCHER_DEBUG, "remove_watch: stopped watching path '{}' on InodeWatcher {}", path, m_watcher_fd);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue