ChangeSet 1.2231.1.156, 2005/03/28 19:59:49-08:00, [email protected]

        [PATCH] Fix POSIX timers expiring before their scheduled time
        
        This patch fixes the problem of POSIX timers returning too early due to 
not
        accounting for the time starting mid jiffie.
        
        Signed-off-by: George Anzinger <[email protected]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 posix-timers.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


diff -Nru a/kernel/posix-timers.c b/kernel/posix-timers.c
--- a/kernel/posix-timers.c     2005-03-28 21:40:48 -08:00
+++ b/kernel/posix-timers.c     2005-03-28 21:40:48 -08:00
@@ -938,6 +938,10 @@
         */
        if (oc.tv_sec < 0)
                oc.tv_sec = oc.tv_nsec = 0;
+
+       if (oc.tv_sec | oc.tv_nsec)
+               set_normalized_timespec(&oc, oc.tv_sec,
+                                       oc.tv_nsec + clock->res);
        tstojiffie(&oc, clock->res, exp);
 
        /*
@@ -1507,7 +1511,6 @@
                if (abs || !rq_time) {
                        adjust_abs_time(&posix_clocks[which_clock], &t, abs,
                                        &rq_time, &dum);
-                       rq_time += (t.tv_sec || t.tv_nsec);
                }
 
                left = rq_time - get_jiffies_64();
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to