blob: d061ae18e7d1d195f705be1e6fc2bec51730edc6 [file] [log] [blame]
Jayanth Othayoth1756c062017-05-23 22:48:11 -05001#include "dump_watch.hpp"
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05002#include "elog-errors.hpp"
3#include "xyz/openbmc_project/Dump/Monitor/error.hpp"
4#include "xyz/openbmc_project/Common/error.hpp"
5
Jayanth Othayoth1756c062017-05-23 22:48:11 -05006#include <phosphor-logging/log.hpp>
7#include <phosphor-logging/elog.hpp>
8#include <phosphor-logging/elog-errors.hpp>
Jayanth Othayoth1756c062017-05-23 22:48:11 -05009
10int main(int argc, char* argv[])
11{
12 sd_event* loop = nullptr;
13 sd_event_default(&loop);
14
15 using namespace phosphor::logging;
16
17 using InvalidCorePath =
18 sdbusplus::xyz::openbmc_project::Dump::Monitor::Error::InvalidCorePath;
19 using InternalFailure =
20 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
21
22 try
23 {
24 phosphor::dump::inotify::Watch watch(loop);
25 sd_event_loop(loop);
26 }
27
28 catch (InvalidCorePath& e)
29 {
30 commit<InvalidCorePath>();
31 return -1;
32 }
33
34 catch (InternalFailure& e)
35 {
36 commit<InternalFailure>();
37 return -1;
38 }
39
40 sd_event_unref(loop);
41
42 return 0;
43}