diff options
author | DexesTTP <dexes.ttp@gmail.com> | 2021-02-08 20:40:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-11 13:13:32 +0100 |
commit | 2acbb811b1751233833f9ea89f7e76774262a706 (patch) | |
tree | 6bd8f5fdcd73bb01258cd2e4feceb2300faea2fb /Userland/Services/CrashDaemon/main.cpp | |
parent | 0304ab3e678151c2f73fd91050a99e8875410ac0 (diff) | |
download | serenity-2acbb811b1751233833f9ea89f7e76774262a706.zip |
LibCore: Added FileWatcher, a binding for the watch_file syscall
This wrapper abstracts the watch_file setup and file handling, and
allows using the watch_file events as part of the event loop via the
Core::Notifier class.
Also renames the existing DirectoryWatcher class to BlockingFileWatcher,
and adds support for the Modified mode in this class.
Diffstat (limited to 'Userland/Services/CrashDaemon/main.cpp')
-rw-r--r-- | Userland/Services/CrashDaemon/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Services/CrashDaemon/main.cpp b/Userland/Services/CrashDaemon/main.cpp index 8dcd318566..b651675864 100644 --- a/Userland/Services/CrashDaemon/main.cpp +++ b/Userland/Services/CrashDaemon/main.cpp @@ -25,7 +25,7 @@ */ #include <AK/LexicalPath.h> -#include <LibCore/DirectoryWatcher.h> +#include <LibCore/FileWatcher.h> #include <LibCoreDump/Backtrace.h> #include <LibCoreDump/Reader.h> #include <serenity.h> @@ -89,11 +89,11 @@ int main() return 1; } - Core::DirectoryWatcher watcher { "/tmp/coredump" }; + Core::BlockingFileWatcher watcher { "/tmp/coredump" }; while (true) { auto event = watcher.wait_for_event(); ASSERT(event.has_value()); - if (event.value().type != Core::DirectoryWatcher::Event::Type::ChildAdded) + if (event.value().type != Core::FileWatcherEvent::Type::ChildAdded) continue; auto coredump_path = event.value().child_path; dbgln("New coredump file: {}", coredump_path); |