*
* Connection Manager
*
- * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
DBusMessageIter iter;
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
goto done;
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
int supplicant_dbus_property_get_all(const char *path, const char *interface,
const char *error;
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
error = dbus_message_get_error_name(reply);
done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
int supplicant_dbus_property_set(const char *path, const char *interface,
const char *error;
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
- return;
if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
error = dbus_message_get_error_name(reply);
else
error = NULL;
- if (dbus_message_iter_init(reply, &iter) == FALSE)
- goto done;
+ dbus_message_iter_init(reply, &iter);
if (data->function != NULL)
data->function(error, &iter, data->user_data);
-done:
dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
}
int supplicant_dbus_method_call(const char *path,
if (connection == NULL)
return -EINVAL;
- if (path == NULL || interface == NULL)
- return -EINVAL;
-
- if (method == NULL || setup == NULL)
+ if (path == NULL || interface == NULL || method == NULL)
return -EINVAL;
data = dbus_malloc0(sizeof(*data));
dbus_message_set_auto_start(message, FALSE);
dbus_message_iter_init_append(message, &iter);
- setup(&iter, user_data);
+ if (setup != NULL)
+ setup(&iter, user_data);
if (dbus_connection_send_with_reply(connection, message,
&call, TIMEOUT) == FALSE) {