Fix iptables-test to work with iptables 1.4.9
[framework/connectivity/connman.git] / tools / supplicant-dbus.c
index 79e7560..96d9aa8 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  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
@@ -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) {