From 9977ed57e554db5d3bc63b6c9e52bd8d2180686c Mon Sep 17 00:00:00 2001 From: Robert Love Date: Mon, 17 Oct 2005 20:29:23 +0000 Subject: [PATCH] 2005-10-17 Robert Love * src/NetworkManagerDevice.c: Actually wait 20s, as we intend, not two seconds -- tries is updated every 1/10 of a second, not every second.. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1033 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 16 +++++++++++----- src/NetworkManagerDevice.c | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5c60f693c..01036f6a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,24 @@ +2005-10-17 Robert Love + + * src/NetworkManagerDevice.c: Actually wait 20s, as we intend, not + two seconds -- tries is updated every 1/10 of a second, not every + second.. + 2005-10-17 Christopher Aillon * gnome/applet/applet-dbus-info.c: Let D-BUS know that we haven't handled a message when we haven't. -2005-10-17 Christopher Aillon - - * gnome/applet/applet-dbus-info.c: - Find network encryption keys asynchronously - 2005-10-17 Robert Love * src/nm-ip4-config.c: use GPOINTER_TO_UINT and not a straight cast in order to remain 64-bit clean. +2005-10-17 Christopher Aillon + + * gnome/applet/applet-dbus-info.c: + Find network encryption keys asynchronously + 2005-10-17 Robert Love * src/backends/NetworkManagerDebian.c, diff --git a/src/NetworkManagerDevice.c b/src/NetworkManagerDevice.c index de32232357..ba6237fef9 100644 --- a/src/NetworkManagerDevice.c +++ b/src/NetworkManagerDevice.c @@ -4433,6 +4433,7 @@ static int hexstr2bin(const char *hex, u8 *buf, size_t len) return 0; } +#define SCAN_SLEEP_CENTISECONDS 10 /* sleep 1/10 of a second, waiting for data */ static guint8 * get_scan_results (NMDevice *dev, NMSock *sk, guint32 *data_len) { struct iwreq iwr; @@ -4469,7 +4470,7 @@ static guint8 * get_scan_results (NMDevice *dev, NMSock *sk, guint32 *data_len) else if (errno == EAGAIN) { /* If the card doesn't return results after 20s, it sucks. */ - if (tries > 20) + if (tries > 20 * SCAN_SLEEP_CENTISECONDS) { nm_warning ("get_scan_results(): card took too much time scanning. Get a better one."); free (res_buf); @@ -4477,7 +4478,7 @@ static guint8 * get_scan_results (NMDevice *dev, NMSock *sk, guint32 *data_len) } g_free (res_buf); - g_usleep (G_USEC_PER_SEC / 10); + g_usleep (G_USEC_PER_SEC / SCAN_SLEEP_CENTISECONDS); tries++; } else