Implementation of create interface.
Both the external and internal Dump managers define "Create"
interfaces. This commit implements these.
Change-Id: If857ec6ea7267fd72e9b420e6b44fa68b6abab66
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/dump_watch.hpp b/dump_watch.hpp
index 3f7bceb..fdd301c 100644
--- a/dump_watch.hpp
+++ b/dump_watch.hpp
@@ -1,47 +1,16 @@
#pragma once
-#include <map>
-#include <memory>
#include <systemd/sd-event.h>
#include <unistd.h>
+#include "dump_utils.hpp"
namespace phosphor
{
namespace dump
{
-
-/** @struct CustomFd
- *
- * RAII wrapper for file descriptor.
- */
-struct CustomFd
-{
- private:
- /** @brief File descriptor */
- int fd = -1;
-
- public:
- CustomFd(const CustomFd&) = delete;
- CustomFd& operator=(const CustomFd&) = delete;
- CustomFd(CustomFd&&) = delete;
- CustomFd& operator=(CustomFd&&) = delete;
-
- /** @brief Saves File descriptor and uses it to do file operation
- *
- * @param[in] fd - File descriptor
- */
- CustomFd(int fd) : fd(fd) {}
-
- ~CustomFd();
-
- int operator()() const
- {
- return fd;
- }
-};
-
namespace inotify
{
+
/** @class Watch
*
* @brief Adds inotify watch on core file directories.