[PATCH 2/2] Better wpa_cli error messages when connect fails.

greearb at candelatech.com greearb
Tue Apr 3 22:15:09 PDT 2012


From: Ben Greear <greearb at candelatech.com>

Signed-hostap: Ben Greear <greearb at candelatech.com>
---
:100644 100644 21a4483... 6dc8b71... M	wpa_supplicant/wpa_cli.c
 wpa_supplicant/wpa_cli.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 21a4483..6dc8b71 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -3807,8 +3807,8 @@ int main(int argc, char *argv[])
 		ctrl_conn = wpa_ctrl_open(global);
 #endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
 		if (ctrl_conn == NULL) {
-			perror("Failed to connect to wpa_supplicant - "
-			       "wpa_ctrl_open");
+			fprintf(stderr, "Failed to connect to wpa_supplicant global interface: %s  error: %s\n",
+				global, strerror(errno));
 			return -1;
 		}
 	}
@@ -3830,8 +3830,8 @@ int main(int argc, char *argv[])
 			}
 
 			if (!warning_displayed) {
-				printf("Could not connect to wpa_supplicant - "
-				       "re-trying\n");
+				printf("Could not connect to wpa_supplicant: %s - "
+				       "re-trying\n", ctrl_ifname);
 				warning_displayed = 1;
 			}
 			os_sleep(1, 0);
@@ -3840,8 +3840,8 @@ int main(int argc, char *argv[])
 	} else {
 		if (!global &&
 		    wpa_cli_open_connection(ctrl_ifname, 0) < 0) {
-			perror("Failed to connect to wpa_supplicant - "
-			       "wpa_ctrl_open");
+			fprintf(stderr, "Warning: failed to connect to non-global ctrl_ifname: %s  error: %s\n",
+			       ctrl_ifname, strerror(errno));
 			return -1;
 		}
 
-- 
1.7.3.4




More information about the Hostap mailing list