summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-01-18 15:28:45 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-01-18 15:28:45 +0000
commitbf41f6ecfbaabcb61638735ff96f3748a4abe9e1 (patch)
treedf0324c1da3bd21ad6599b643dd52bdb50c2db8d
parent5858bd3c137c3ad9d46e7fc4b85cb6c8e483d2d2 (diff)
libiwinfo: fail after 5 tries when there's no response from wpa_supplicant
-rw-r--r--contrib/package/iwinfo/src/iwinfo_nl80211.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_nl80211.c b/contrib/package/iwinfo/src/iwinfo_nl80211.c
index aca2be233..fa714e906 100644
--- a/contrib/package/iwinfo/src/iwinfo_nl80211.c
+++ b/contrib/package/iwinfo/src/iwinfo_nl80211.c
@@ -356,6 +356,7 @@ static inline int nl80211_wpactl_recv(int sock, char *buf, int blen)
static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
const char *event)
{
+ int numtry = 0;
int sock = -1;
char *rv = NULL;
size_t remote_length, local_length;
@@ -395,7 +396,7 @@ static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
send(sock, cmd, strlen(cmd), 0);
- while( 1 )
+ while( numtry++ < 5 )
{
if( nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0 )
{