]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix really stupid error in computation of timeout point in nonblocking
authorJulian Seward <jseward@acm.org>
Mon, 29 Apr 2002 12:20:34 +0000 (12:20 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 29 Apr 2002 12:20:34 +0000 (12:20 +0000)
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
coregrind/vg_libpthread.c
vg_libpthread.c

index bc9a0e8f3ff0b3fd1e58de299b388db3b4f8ac84..171e2836dcf7b9b5a07ac7cb1386e0203a9657d6 100644 (file)
@@ -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"); */
index bc9a0e8f3ff0b3fd1e58de299b388db3b4f8ac84..171e2836dcf7b9b5a07ac7cb1386e0203a9657d6 100644 (file)
@@ -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"); */
index bc9a0e8f3ff0b3fd1e58de299b388db3b4f8ac84..171e2836dcf7b9b5a07ac7cb1386e0203a9657d6 100644 (file)
@@ -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"); */