std::signal(SIGTERM, __on_signal);
std::signal(SIGQUIT, __on_signal);
- AgentDBus agentDBus;
- AgentUtil agentUtil(agentDBus);
- PluginLoader pluginLoader(agentUtil);
- AgentSocket agentSocket(pluginLoader);
-
+ try {
+ AgentDBus agentDBus;
+ AgentUtil agentUtil(agentDBus);
+ PluginLoader pluginLoader(agentUtil);
+ AgentSocket agentSocket(pluginLoader);
+ } catch (...) {
+ _E("Initialization Fail");
+ return EXIT_FAILURE;
+ }
sd_notify(0, "READY=1");
__mainLoop.start();
IF_FAIL_RETURN_TAG(strlen(path) < sizeof(addr.sun_path), false, _E, "Invalid path");
sock = socket(AF_UNIX, SOCK_STREAM, 0);
- IF_FAIL_RETURN_TAG(sock > 0, false, _E, "socket creation failed");
+ IF_FAIL_RETURN_TAG(sock != -1, false, _E, "socket creation failed");
bzero(&addr, sizeof(addr));
addr.sun_family = AF_UNIX;