From feaee3ac3ac9a2a1ffdb124de73eaec90ed41a19 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 29 Apr 2002 12:20:34 +0000 Subject: [PATCH] Fix really stupid error in computation of timeout point in nonblocking poll(). After this change, Mozilla-0.9.2.1 and Galeon 0.11.3 finally behave reasonably on my box. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@165 --- coregrind/arch/x86-linux/vg_libpthread.c | 2 +- coregrind/vg_libpthread.c | 2 +- vg_libpthread.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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"); */