DA: Skip initializing failed_bssids list when eapol failure case
[platform/upstream/connman.git] / gdbus / object.c
old mode 100644 (file)
new mode 100755 (executable)
index 13cf9a9..c333d5b
@@ -258,7 +258,8 @@ static DBusHandlerResult process_message(DBusConnection *connection,
 
        reply = method->function(connection, message, iface_user_data);
 
-       if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
+       if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY ||
+                                       dbus_message_get_no_reply(message)) {
                if (reply != NULL)
                        dbus_message_unref(reply);
                return DBUS_HANDLER_RESULT_HANDLED;
@@ -1088,7 +1089,6 @@ static const GDBusMethodTable introspect_methods[] = {
 static void append_interfaces(struct generic_data *data, DBusMessageIter *iter)
 {
        DBusMessageIter array;
-       GSList *l;
 
        dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
                                DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
@@ -1100,12 +1100,7 @@ static void append_interfaces(struct generic_data *data, DBusMessageIter *iter)
                                DBUS_DICT_ENTRY_END_CHAR_AS_STRING
                                DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &array);
 
-       for (l = data->interfaces; l != NULL; l = l->next) {
-               if (g_slist_find(data->added, l->data))
-                       continue;
-
-               append_interface(l->data, &array);
-       }
+       g_slist_foreach(data->interfaces, append_interface, &array);
 
        dbus_message_iter_close_container(iter, &array);
 }
@@ -1253,8 +1248,10 @@ static struct generic_data *object_path_ref(DBusConnection *connection,
 
        if (!dbus_connection_register_object_path(connection, path,
                                                &generic_table, data)) {
+#if !defined TIZEN_EXT
                dbus_connection_unref(data->conn);
                g_free(data->path);
+#endif
                g_free(data->introspect);
                g_free(data);
                return NULL;
@@ -1418,7 +1415,10 @@ DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
 {
        char str[1024];
 
-       vsnprintf(str, sizeof(str), format, args);
+       if (format)
+               vsnprintf(str, sizeof(str), format, args);
+       else
+               str[0] = '\0';
 
        return dbus_message_new_error(message, name, str);
 }
@@ -1536,11 +1536,8 @@ gboolean g_dbus_send_error_valist(DBusConnection *connection,
                                        const char *format, va_list args)
 {
        DBusMessage *error;
-       char str[1024];
 
-       vsnprintf(str, sizeof(str), format, args);
-
-       error = dbus_message_new_error(message, name, str);
+       error = g_dbus_create_error_valist(message, name, format, args);
        if (error == NULL)
                return FALSE;
 
@@ -1726,9 +1723,10 @@ static void process_property_changes(struct generic_data *data)
        }
 }
 
-void g_dbus_emit_property_changed(DBusConnection *connection,
+void g_dbus_emit_property_changed_full(DBusConnection *connection,
                                const char *path, const char *interface,
-                               const char *name)
+                               const char *name,
+                               GDbusPropertyChangedFlags flags)
 {
        const GDBusPropertyTable *property;
        struct generic_data *data;
@@ -1766,7 +1764,16 @@ void g_dbus_emit_property_changed(DBusConnection *connection,
        iface->pending_prop = g_slist_prepend(iface->pending_prop,
                                                (void *) property);
 
-       add_pending(data);
+       if (flags & G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH)
+               process_property_changes(data);
+       else
+               add_pending(data);
+}
+
+void g_dbus_emit_property_changed(DBusConnection *connection, const char *path,
+                               const char *interface, const char *name)
+{
+       g_dbus_emit_property_changed_full(connection, path, interface, name, 0);
 }
 
 gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
@@ -1822,3 +1829,8 @@ void g_dbus_set_flags(int flags)
 {
        global_flags = flags;
 }
+
+int g_dbus_get_flags(void)
+{
+       return global_flags;
+}