aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_old_handlers.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-01 18:50:12 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-01 18:50:12 (GMT)
commitc2b8c674cb30c677be4245a5aab132c56bfd7a12 (patch)
treeca1ee16e1eb8dd326651758c3aecc4cba098da5c /wpa_supplicant/dbus/dbus_old_handlers.c
parentc49cf2d68f08764ec7f76bf6cfdaedd7912fcaa5 (diff)
downloadhostap-c2b8c674cb30c677be4245a5aab132c56bfd7a12.zip
hostap-c2b8c674cb30c677be4245a5aab132c56bfd7a12.tar.gz
hostap-c2b8c674cb30c677be4245a5aab132c56bfd7a12.tar.bz2
dbus: Remove perror() calls
The perror() calls do not make much sense with libdbus functions and wpa_printf() would really be used for all error printing anyway. In addition, many of the error messages on out-of-memory cases are not really of much use, so they were removed. This is also cleaning up some of the error path handling to avoid duplicated code.
Diffstat (limited to 'wpa_supplicant/dbus/dbus_old_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_old_handlers.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c b/wpa_supplicant/dbus/dbus_old_handlers.c
index 8371363..ca2d755 100644
--- a/wpa_supplicant/dbus/dbus_old_handlers.c
+++ b/wpa_supplicant/dbus/dbus_old_handlers.c
@@ -362,10 +362,9 @@ DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message,
/* Ensure we've actually got scan results to return */
if (wpa_s->scan_res == NULL &&
wpa_supplicant_get_scan_results(wpa_s) < 0) {
- reply = dbus_message_new_error(message, WPAS_ERROR_SCAN_ERROR,
- "An error ocurred getting scan "
+ return dbus_message_new_error(message, WPAS_ERROR_SCAN_ERROR,
+ "An error ocurred getting scan "
"results.");
- goto out;
}
/* Create and initialize the return message */
@@ -382,11 +381,8 @@ DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message,
path = os_zalloc(WPAS_DBUS_OBJECT_PATH_MAX);
if (path == NULL) {
- perror("wpas_dbus_iface_scan_results[dbus]: out of "
- "memory.");
- wpa_printf(MSG_ERROR, "dbus control interface: not "
- "enough memory to send scan results "
- "signal.");
+ wpa_printf(MSG_ERROR, "dbus: Not enough memory to "
+ "send scan results signal");
break;
}
/* Construct the object path for this network. Note that ':'
@@ -403,7 +399,6 @@ DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message,
dbus_message_iter_close_container(&iter, &sub_iter);
-out:
return reply;
}
@@ -810,11 +805,8 @@ DBusMessage * wpas_dbus_iface_add_network(DBusMessage *message,
path = os_zalloc(WPAS_DBUS_OBJECT_PATH_MAX);
if (path == NULL) {
- perror("wpas_dbus_iface_scan_results[dbus]: out of "
- "memory.");
- wpa_printf(MSG_ERROR, "dbus control interface: not "
- "enough memory to send scan results "
- "signal.");
+ wpa_printf(MSG_ERROR, "dbus: Not enough memory to send scan "
+ "results signal");
goto out;
}
@@ -1324,10 +1316,8 @@ DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &scanning,
DBUS_TYPE_INVALID);
} else {
- perror("wpas_dbus_iface_get_scanning[dbus]: out of "
- "memory.");
- wpa_printf(MSG_ERROR, "dbus control interface: not enough "
- "memory to return scanning state.");
+ wpa_printf(MSG_ERROR, "dbus: Not enough memory to return "
+ "scanning state");
}
return reply;