1 #include <cstdlib>
2 #include <exception>
3 #include <sdbusplus/bus.hpp>
4 #include <phosphor-logging/log.hpp>
5 #include "config.h"
6 #include "version_software_manager.hpp"
7 #include "watch.hpp"
8 
9 int main(int argc, char* argv[])
10 {
11     auto bus = sdbusplus::bus::new_default();
12 
13     sd_event* loop = nullptr;
14     sd_event_default(&loop);
15 
16     sdbusplus::server::manager::manager objManager(bus,
17             SOFTWARE_OBJPATH);
18     phosphor::software::manager::Version manager(bus,
19             SOFTWARE_OBJPATH);
20     bus.request_name(VERSION_BUSNAME);
21 
22     try
23     {
24         phosphor::software::manager::Watch watch(loop);
25         bus.attach_event(loop, SD_EVENT_PRIORITY_NORMAL);
26         sd_event_loop(loop);
27     }
28     catch (std::exception& e)
29     {
30         using namespace phosphor::logging;
31         log<level::ERR>(e.what());
32         return -1;
33     }
34 
35     sd_event_unref(loop);
36 
37     return 0;
38 }
39