summaryrefslogtreecommitdiff
path: root/tools/supplicant-dbus.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-01-01 17:00:54 -0800
committerMarcel Holtmann <marcel@holtmann.org>2010-01-01 17:00:54 -0800
commit9b2f0b7c60dce9ee9f5184e499bc9ddefe6dbdfa (patch)
tree0f74d0eeb9ee0a4582ca78ca978c973c87ebc53a /tools/supplicant-dbus.c
parent0128d468175f11dc2d90480f9a3e95d4175fe937 (diff)
downloadconnman-9b2f0b7c60dce9ee9f5184e499bc9ddefe6dbdfa.tar.gz
connman-9b2f0b7c60dce9ee9f5184e499bc9ddefe6dbdfa.tar.bz2
connman-9b2f0b7c60dce9ee9f5184e499bc9ddefe6dbdfa.zip
Add initial support for scanning in supplicant test program
Diffstat (limited to 'tools/supplicant-dbus.c')
-rw-r--r--tools/supplicant-dbus.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/supplicant-dbus.c b/tools/supplicant-dbus.c
index 79e75603..95da1d9d 100644
--- a/tools/supplicant-dbus.c
+++ b/tools/supplicant-dbus.c
@@ -298,13 +298,11 @@ static void method_call_reply(DBusPendingCall *call, void *user_data)
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);
@@ -324,10 +322,7 @@ 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));
@@ -344,7 +339,8 @@ int supplicant_dbus_method_call(const char *path,
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) {