From: George Anzinger <george@mvista.com>

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 <george@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

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

diff -puN kernel/posix-timers.c~fix-posix-timers-expiring-before-their-scheduled-time kernel/posix-timers.c
--- 25/kernel/posix-timers.c~fix-posix-timers-expiring-before-their-scheduled-time	2005-03-18 23:49:15.000000000 -0800
+++ 25-akpm/kernel/posix-timers.c	2005-03-18 23:49:15.000000000 -0800
@@ -938,6 +938,10 @@ static int adjust_abs_time(struct k_cloc
 	 */
 	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 @@ static int common_nsleep(clockid_t which
 		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();
_