Add support for generic inotify based directory watch.
Watch a directory for the changes based on user configuration
and then report changes to the user.
Change-Id: I9f53d3135dd4bff6187840c0c53d2a64509808cd
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/dump_utils.hpp b/dump_utils.hpp
index a71458c..6ebee33 100644
--- a/dump_utils.hpp
+++ b/dump_utils.hpp
@@ -1,10 +1,23 @@
#pragma once
+#include <memory>
+#include <unistd.h>
+
namespace phosphor
{
namespace dump
{
+/* Need a custom deleter for freeing up sd_event */
+struct EventDeleter
+{
+ void operator()(sd_event* event) const
+ {
+ event = sd_event_unref(event);
+ }
+};
+using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
+
/** @struct CustomFd
*
* RAII wrapper for file descriptor.