1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

LibCore+ConfigServer: Add FileWatcherFlags to replace InodeWatcherFlags

InodeWatcherFlags is an enumeration from the Kernel. To avoid using it
outside of Serenity, add a FileWatcherFlags for FileWatcher, much like
we already have FileWatcherEvent::Type.
This commit is contained in:
Timothy Flynn 2023-01-18 08:54:39 -05:00 committed by Tim Flynn
parent 98e6dbf50a
commit 142abc0b2e
5 changed files with 33 additions and 17 deletions

View file

@ -39,7 +39,7 @@ static Core::ConfigFile& ensure_domain_config(DeprecatedString const& domain)
auto config = Core::ConfigFile::open_for_app(domain, Core::ConfigFile::AllowWriting::Yes).release_value_but_fixme_should_propagate_errors();
// FIXME: Use a single FileWatcher with multiple watches inside.
auto watcher_or_error = Core::FileWatcher::create(InodeWatcherFlags::Nonblock);
auto watcher_or_error = Core::FileWatcher::create(Core::FileWatcherFlags::Nonblock);
VERIFY(!watcher_or_error.is_error());
auto result = watcher_or_error.value()->add_watch(config->filename(), Core::FileWatcherEvent::Type::ContentModified);
VERIFY(!result.is_error());