[patch] min_delay bugfix.



Dan,

In src/NetworkManagerDevice.c :: nm_device_wireless_wait_for_link(), we
set min_delay to

	const guint	delay = 30;
 	const guint	required_tries = 10;
	const guint	min_delay = 2 * (required_tries / delay);

That is zero.

We then compare it to the timeout, an unsigned int.  The comparison is
always false.

Based on a comment below (which says we want to round the timeout up to
6 seconds), I think we really want

	const guint	min_delay = 2 * (delay / required_tries);

Attached patch does that.

Correct?  If so, may I commit?

	Robert Love

Index: src/NetworkManagerDevice.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/NetworkManagerDevice.c,v
retrieving revision 1.142
diff -u -u -r1.142 NetworkManagerDevice.c
--- src/NetworkManagerDevice.c	21 Jun 2005 15:07:01 -0000	1.142
+++ src/NetworkManagerDevice.c	23 Jun 2005 19:55:29 -0000
@@ -2348,7 +2348,7 @@
 	 * also want the maximum to be based on what the card */
 	const guint	delay = 30;
 	const guint	required_tries = 10;
-	const guint	min_delay = 2 * (required_tries / delay);
+	const guint	min_delay = 2 * (delay / required_tries);
 
 	g_return_val_if_fail (dev != NULL, FALSE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]