diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index bc9a0e8f3..171e2836d 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -1295,7 +1295,7 @@ int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) /* If a timeout was specified, set ms_end to be the end wallclock time. Easy considering that __timeout is in milliseconds. */ if (__timeout > 0) { - ms_end += (unsigned int)__timeout; + ms_end = ms_now + (unsigned int)__timeout; } /* fprintf(stderr, "MY_POLL: before loop\n"); */ diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index bc9a0e8f3..171e2836d 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1295,7 +1295,7 @@ int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) /* If a timeout was specified, set ms_end to be the end wallclock time. Easy considering that __timeout is in milliseconds. */ if (__timeout > 0) { - ms_end += (unsigned int)__timeout; + ms_end = ms_now + (unsigned int)__timeout; } /* fprintf(stderr, "MY_POLL: before loop\n"); */ diff --git a/vg_libpthread.c b/vg_libpthread.c index bc9a0e8f3..171e2836d 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1295,7 +1295,7 @@ int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) /* If a timeout was specified, set ms_end to be the end wallclock time. Easy considering that __timeout is in milliseconds. */ if (__timeout > 0) { - ms_end += (unsigned int)__timeout; + ms_end = ms_now + (unsigned int)__timeout; } /* fprintf(stderr, "MY_POLL: before loop\n"); */