From: Julian Seward Date: Mon, 29 Apr 2002 12:20:34 +0000 (+0000) Subject: Fix really stupid error in computation of timeout point in nonblocking X-Git-Tag: svn/VALGRIND_1_0_3~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feaee3ac3ac9a2a1ffdb124de73eaec90ed41a19;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index bc9a0e8f3f..171e2836dc 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 bc9a0e8f3f..171e2836dc 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 bc9a0e8f3f..171e2836dc 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"); */