Register with system bus in container environment
[platform/upstream/connman.git] / src / main.c
index 34d572d..278b502 100755 (executable)
@@ -48,6 +48,7 @@
 
 #if defined TIZEN_EXT
 #define DEFAULT_WIFI_INTERFACE "wlan0"
+#define CONTAINER_FILE "/run/systemd/container"
 #endif
 
 #define MAINFILE "main.conf"
@@ -766,6 +767,8 @@ static void parse_config(GKeyFile *config)
                connman_settings.auto_connect =
                        parse_service_types(default_auto_connect, CONF_ARRAY_SIZE(default_auto_connect));
 
+       g_strfreev(str_list);
+
        g_clear_error(&error);
 
        str_list = __connman_config_get_string_list(config, "General",
@@ -1376,6 +1379,21 @@ int main(int argc, char *argv[])
 
        __connman_dbus_init(conn);
 
+#if defined TIZEN_EXT
+       if (access(CONTAINER_FILE, F_OK) == 0) {
+               g_main_loop_run(main_loop);
+
+               g_source_remove(signal);
+               dbus_connection_unref(conn);
+               g_main_loop_unref(main_loop);
+
+               __connman_dbus_cleanup();
+               __connman_log_cleanup(option_backtrace);
+
+               return 0;
+       }
+#endif
+
        if (!option_config)
                config_init(CONFIGMAINFILE);
        else