daemon: jmcore proxy initialization and improved error handling in main()
This commit is contained in:
parent
31f6cb939b
commit
e0756fe0ee
|
@ -42,6 +42,7 @@
|
||||||
#include "../catdup.h"
|
#include "../catdup.h"
|
||||||
#include "dirhelpers.h"
|
#include "dirhelpers.h"
|
||||||
#include "../proxies/a2j_proxy.h"
|
#include "../proxies/a2j_proxy.h"
|
||||||
|
#include "../proxies/jmcore_proxy.h"
|
||||||
|
|
||||||
bool g_quit;
|
bool g_quit;
|
||||||
const char * g_dbus_unique_name;
|
const char * g_dbus_unique_name;
|
||||||
|
@ -292,11 +293,19 @@ int main(int argc, char ** argv, char ** envp)
|
||||||
/* setup our SIGSEGV magic that prints nice stack in our logfile */
|
/* setup our SIGSEGV magic that prints nice stack in our logfile */
|
||||||
setup_sigsegv();
|
setup_sigsegv();
|
||||||
|
|
||||||
a2j_proxy_init();
|
if (!a2j_proxy_init())
|
||||||
|
{
|
||||||
|
goto uninit_dbus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!jmcore_proxy_init())
|
||||||
|
{
|
||||||
|
goto uninit_a2j;
|
||||||
|
}
|
||||||
|
|
||||||
if (!studio_init())
|
if (!studio_init())
|
||||||
{
|
{
|
||||||
goto uninit_dbus;
|
goto uninit_jmcore;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!g_quit)
|
while (!g_quit)
|
||||||
|
@ -314,6 +323,10 @@ int main(int argc, char ** argv, char ** envp)
|
||||||
|
|
||||||
studio_uninit();
|
studio_uninit();
|
||||||
|
|
||||||
|
uninit_jmcore:
|
||||||
|
jmcore_proxy_uninit();
|
||||||
|
|
||||||
|
uninit_a2j:
|
||||||
a2j_proxy_uninit();
|
a2j_proxy_uninit();
|
||||||
|
|
||||||
uninit_dbus:
|
uninit_dbus:
|
||||||
|
|
|
@ -47,6 +47,8 @@ bool jmcore_proxy_init(void)
|
||||||
|
|
||||||
void jmcore_proxy_uninit(void)
|
void jmcore_proxy_uninit(void)
|
||||||
{
|
{
|
||||||
|
dbus_unregister_object_signal_hooks(g_dbus_connection, JMCORE_SERVICE_NAME, JMCORE_OBJECT_PATH, JMCORE_IFACE);
|
||||||
|
dbus_unregister_service_lifetime_hook(g_dbus_connection, JMCORE_SERVICE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int64_t jmcore_proxy_get_pid_cached(void)
|
const int64_t jmcore_proxy_get_pid_cached(void)
|
||||||
|
|
Loading…
Reference in New Issue