stc_deinit_db_guard();
stc_db_deinitialize();
+ iptables_flush_chains();
iptables_deinit();
stc_manager_gdbus_deinit((gpointer)g_stc);
stc_app_lifecycle_monitor_deinit();
stc = MALLOC0(stc_s, 1);
if (!stc) {
- STC_LOGE("Failed to allocate memory for manager structure");
- return NULL;
+ STC_LOGE("Failed to allocate memory for manager structure"); //LCOV_EXCL_LINE
+ return NULL; //LCOV_EXCL_LINE
}
g_stc = stc;
return stc;
handle_error:
- STC_LOGD("Failed to initialize stc manager");
- __stc_manager_deinit();
- return NULL;
+ STC_LOGD("Failed to initialize stc manager"); //LCOV_EXCL_LINE
+ __stc_manager_deinit(); //LCOV_EXCL_LINE
+ return NULL; //LCOV_EXCL_LINE
}
stc_s *stc_get_manager(void)
return g_stc;
}
+void stc_stop_manager(void)
+{
+ if (g_stc && g_stc->main_loop)
+ g_main_loop_quit(g_stc->main_loop);
+}
+
gint32 main(gint32 argc, gchar *argv[])
{
GMainLoop *main_loop = NULL;
STC_LOGI("Smart Traffic Control Manager");
+#ifdef TIZEN_GTESTS
+ setenv("GCOV_PREFIX", "/tmp/daemon", 1);
+#endif
+
if (daemon(0, 0) != 0)
- STC_LOGE("Can't start daemon");
+ STC_LOGE("Can't start daemon"); //LCOV_EXCL_LINE
/* Initialize required subsystems */
#if !GLIB_CHECK_VERSION(2, 35, 0)