diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-15 04:51:40 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-15 04:51:40 -0500 |
commit | f055408957750cf759162c364c2a4dfe19765844 (patch) | |
tree | aecc0a13c582d310902e6fa95d8853c627828fcc /kernel/posix-timers.c | |
parent | 83cbd33aae2c3cd14f80a8abf733033a57aa4923 (diff) | |
parent | 4060994c3e337b40e0f6fa8ce2cc178e021baf3d (diff) | |
download | op-kernel-dev-f055408957750cf759162c364c2a4dfe19765844.zip op-kernel-dev-f055408957750cf759162c364c2a4dfe19765844.tar.gz |
Merge branch 'master'
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index ea55c7a..5870efb 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -270,7 +270,7 @@ static void tstojiffie(struct timespec *tp, int res, u64 *jiff) long sec = tp->tv_sec; long nsec = tp->tv_nsec + res - 1; - if (nsec > NSEC_PER_SEC) { + if (nsec >= NSEC_PER_SEC) { sec++; nsec -= NSEC_PER_SEC; } @@ -1209,13 +1209,9 @@ static int do_posix_clock_monotonic_get(clockid_t clock, struct timespec *tp) do_posix_clock_monotonic_gettime_parts(tp, &wall_to_mono); - tp->tv_sec += wall_to_mono.tv_sec; - tp->tv_nsec += wall_to_mono.tv_nsec; + set_normalized_timespec(tp, tp->tv_sec + wall_to_mono.tv_sec, + tp->tv_nsec + wall_to_mono.tv_nsec); - if ((tp->tv_nsec - NSEC_PER_SEC) > 0) { - tp->tv_nsec -= NSEC_PER_SEC; - tp->tv_sec++; - } return 0; } |