James Lentini wrote:
On Mon, 25 Jul 2005, Arlin Davis wrote:
James,
Here is a patch to fix dapl_os_wait_object_wait() returning
EINVAL when passing nsec == 1000000000 to pthread_cond_timedwait().
Hit a rare case where _microsecs was exactly 1000000.
What was the timeout_val being passed to dapl_os_wait_object_wait()?
Was it 1000000000 or 1000000?
It was the calculated time of microsecs that resulted in exactly 1000000
(1 sec) not timeout_val..
Thanks,
-arlin
Signed-off by: Arlin Davis <[EMAIL PROTECTED]>
Index: dapl/udapl/linux/dapl_osd.c
===================================================================
--- dapl/udapl/linux/dapl_osd.c (revision 2899)
+++ dapl/udapl/linux/dapl_osd.c (working copy)
@@ -242,16 +242,9 @@
gettimeofday (&now, &tz);
microsecs = now.tv_usec + (timeout_val % 1000000);
- if (microsecs > 1000000)
- {
- now.tv_sec = now.tv_sec + timeout_val / 1000000 + 1;
- now.tv_usec = microsecs - 1000000;
- }
- else
- {
- now.tv_sec = now.tv_sec + timeout_val / 1000000;
- now.tv_usec = microsecs;
- }
+
+ now.tv_sec = now.tv_sec + timeout_val/1000000 +
(microsecs/1000000);
+ now.tv_usec = microsecs % 1000000;
/* Convert timeval to timespec */
future.tv_sec = now.tv_sec;
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-general
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general