[openib-general] Re: [PATCH] uDAPL dapl_os_wait_object_wait()
James Lentini
jlentini at netapp.com
Tue Aug 2 15:06:30 PDT 2005
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?
>
> Thanks,
>
> -arlin
>
> Signed-off by: Arlin Davis <ardavis at ichips.intel.com>
>
> 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;
More information about the general
mailing list