__unblock_sigchld();
}
+static gboolean __watchdog_cb(gpointer data)
+{
+ sd_notify(0, "WATCHDOG=1");
+ _E("called sd_notify() WATCHDOG");
+ return G_SOURCE_CONTINUE;
+}
+
EXPORT int amd_main(int argc, char *argv[])
{
GMainLoop *mainloop = NULL;
+ guint timer;
+
+ timer = g_timeout_add_seconds(10, __watchdog_cb, NULL);
+ if (timer == 0) {
+ _E("g_timeout_add_seconds() is failed");
+ return -1;
+ }
if (__init() != 0) {
_E("AMD Initialization failed!\n");
+ g_source_remove(timer);
return -1;
}
mainloop = g_main_loop_new(NULL, FALSE);
if (!mainloop) {
_E("failed to create glib main loop");
+ g_source_remove(timer);
return -1;
}
g_main_loop_run(mainloop);
+ g_source_remove(timer);
__finish();