[Spread-cvs] commit: r366 - branches/branch_3_17/daemon

jonathan at spread.org jonathan at spread.org
Wed Nov 15 10:29:20 EST 2006


Author: jonathan
Date: 2006-11-15 10:29:19 -0500 (Wed, 15 Nov 2006)
New Revision: 366

Modified:
   branches/branch_3_17/daemon/Changelog
   branches/branch_3_17/daemon/sp.c
Log:
Initialize wait_timeout in all cases, even if blocking.


Modified: branches/branch_3_17/daemon/Changelog
===================================================================
--- branches/branch_3_17/daemon/Changelog	2006-11-14 09:50:26 UTC (rev 365)
+++ branches/branch_3_17/daemon/Changelog	2006-11-15 15:29:19 UTC (rev 366)
@@ -1,3 +1,8 @@
+Wed Nov 15 10:27:33 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
+
+	* sp.c (connect_nointr_timeout): Move wait_timeout 
+	initialization up so it always happens, even for blocking.
+
 Tue Nov 14 01:40:43 2006  Jonathan Stanton  <jonathan at cnds.jhu.edu>
 
 	* sp.c (SP_connect_timeout): Rename variables to make more

Modified: branches/branch_3_17/daemon/sp.c
===================================================================
--- branches/branch_3_17/daemon/sp.c	2006-11-14 09:50:26 UTC (rev 365)
+++ branches/branch_3_17/daemon/sp.c	2006-11-15 15:29:19 UTC (rev 366)
@@ -250,13 +250,15 @@
     int         ret_ioctl;
     sockopt_len_t   elen;
 
+    /* initialize time values even if blocking so later use is valid */
+    start_time = E_get_time();
+    target_time = E_add_time(start_time, *time_out);
+    wait_time = *time_out;
+
     if ( E_compare_time(Zero_timeout, *time_out) < 0 )
     {
+        /* set file descriptor to non-blocking */
         non_blocking = 1;
-        start_time = E_get_time();
-        target_time = E_add_time(start_time, *time_out);
-        wait_time = *time_out;
-        /* set file descriptor to non-blocking */
         on = 1;
         ret_ioctl = ioctl( s, FIONBIO, &on);
     }




More information about the Spread-cvs mailing list