aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ctrl_iface_udp.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-24 10:43:35 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-26 11:20:57 (GMT)
commita193231dfb0ea5e7a5cf66e7e314a6d845768241 (patch)
tree74b25eb580732d91f678c93952eb2958efa12b44 /wpa_supplicant/ctrl_iface_udp.c
parentcad9b88be2ad3c0eaa52bdda2435a0b719a60915 (diff)
downloadhostap-a193231dfb0ea5e7a5cf66e7e314a6d845768241.zip
hostap-a193231dfb0ea5e7a5cf66e7e314a6d845768241.tar.gz
hostap-a193231dfb0ea5e7a5cf66e7e314a6d845768241.tar.bz2
Clean up debug prints to use wpa_printf()
This converts most of the remaining perror() and printf() calls from hostapd and wpa_supplicant to use wpa_printf(). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ctrl_iface_udp.c')
-rw-r--r--wpa_supplicant/ctrl_iface_udp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
index 9d0674d..bf6a3df 100644
--- a/wpa_supplicant/ctrl_iface_udp.c
+++ b/wpa_supplicant/ctrl_iface_udp.c
@@ -218,7 +218,8 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
(struct sockaddr *) &from, &fromlen);
if (res < 0) {
- perror("recvfrom(ctrl_iface)");
+ wpa_printf(MSG_ERROR, "recvfrom(ctrl_iface): %s",
+ strerror(errno));
return;
}
@@ -356,7 +357,7 @@ wpa_supplicant_ctrl_iface_init(struct wpa_supplicant *wpa_s)
priv->sock = socket(domain, SOCK_DGRAM, 0);
if (priv->sock < 0) {
- perror("socket(PF_INET)");
+ wpa_printf(MSG_ERROR, "socket(PF_INET): %s", strerror(errno));
goto fail;
}
@@ -386,7 +387,7 @@ try_again:
port--;
if ((WPA_CTRL_IFACE_PORT - port) < WPA_CTRL_IFACE_PORT_LIMIT)
goto try_again;
- perror("bind(AF_INET)");
+ wpa_printf(MSG_ERROR, "bind(AF_INET): %s", strerror(errno));
goto fail;
}
@@ -482,7 +483,9 @@ static void wpa_supplicant_ctrl_iface_send(struct ctrl_iface_priv *priv,
if (sendto(priv->sock, sbuf, llen + len, 0,
(struct sockaddr *) &dst->addr,
sizeof(dst->addr)) < 0) {
- perror("sendto(CTRL_IFACE monitor)");
+ wpa_printf(MSG_ERROR,
+ "sendto(CTRL_IFACE monitor): %s",
+ strerror(errno));
dst->errors++;
if (dst->errors > 10) {
wpa_supplicant_ctrl_iface_detach(
@@ -551,7 +554,8 @@ static void wpa_supplicant_global_ctrl_iface_receive(int sock, void *eloop_ctx,
res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
(struct sockaddr *) &from, &fromlen);
if (res < 0) {
- perror("recvfrom(ctrl_iface)");
+ wpa_printf(MSG_ERROR, "recvfrom(ctrl_iface): %s",
+ strerror(errno));
return;
}
@@ -634,7 +638,7 @@ wpa_supplicant_global_ctrl_iface_init(struct wpa_global *global)
priv->sock = socket(PF_INET, SOCK_DGRAM, 0);
if (priv->sock < 0) {
- perror("socket(PF_INET)");
+ wpa_printf(MSG_ERROR, "socket(PF_INET): %s", strerror(errno));
goto fail;
}
@@ -652,7 +656,7 @@ try_again:
if ((port - WPA_GLOBAL_CTRL_IFACE_PORT) <
WPA_GLOBAL_CTRL_IFACE_PORT_LIMIT)
goto try_again;
- perror("bind(AF_INET)");
+ wpa_printf(MSG_ERROR, "bind(AF_INET): %s", strerror(errno));
goto fail;
}