diff --git a/ChangeLog b/ChangeLog index 4e0e1ca425..38ff03309a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-04-01 Dan Williams + + * src/NetworkManagerDevice.c: + - (nm_completion_scan_has_results): restore pre-completion-patch behavior + of only erroring after the second consecutive scan times out. Also + don't exit when the card requires more time than we can give it, just + log the event and continue. + 2005-04-01 Steve Murphy * configure.in: Added "rw" to ALL_LINGUAS. diff --git a/src/NetworkManagerDevice.c b/src/NetworkManagerDevice.c index 91a51b2e64..2341fab55e 100644 --- a/src/NetworkManagerDevice.c +++ b/src/NetworkManagerDevice.c @@ -3690,14 +3690,26 @@ static gboolean nm_completion_scan_has_results (int tries, va_list args) g_return_val_if_fail (scan_results != NULL, TRUE); rc = iw_scan(sk, (char *)nm_device_get_iface (dev), WIRELESS_EXT, &(scan_results->scan_head)); + *err = FALSE; if (rc == -1 && errno == ETIME) { - nm_error ("Warning: the wireless card (%s) requires too much time for scans. Its driver needs to be fixed.", nm_device_get_iface (dev)); - scan_results->scan_head.result = NULL; - *err = TRUE; - return TRUE; + /* Scans take time. iw_scan's timeout is 15 seconds, so if the card hasn't returned + * scan results after two consecutive runs of iw_scan(), the card sucks. + */ + if (tries >= 1) + { + nm_warning ("Warning: the wireless card (%s) requires too much time for scans. Its driver needs to be fixed.", nm_device_get_iface (dev)); + scan_results->scan_head.result = NULL; + *err = TRUE; + return TRUE; + } + else + { + /* Give the card one more chance to return scan results */ + scan_results->scan_head.result = NULL; + return FALSE; + } } - *err = FALSE; if ((rc == -1 && errno == ENODATA) || (rc == 0 && scan_results->scan_head.result == NULL)) { /* Card hasn't had time yet to compile full access point list.