Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14089
b: refs/heads/master
c: 3f39894
h: refs/heads/master
i:
  14087: 7fb6112
v: v3
  • Loading branch information
George Anzinger authored and Linus Torvalds committed Nov 14, 2005
1 parent a0f4820 commit 0164bce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09e12f9f6bcd9af516d901223cebdbae58b32c9f
refs/heads/master: 3f39894d1b5c253b10fcb8fbbbcf65a330f6cdc7
2 changes: 1 addition & 1 deletion trunk/include/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
static inline void
set_normalized_timespec (struct timespec *ts, time_t sec, long nsec)
{
while (nsec > NSEC_PER_SEC) {
while (nsec >= NSEC_PER_SEC) {
nsec -= NSEC_PER_SEC;
++sec;
}
Expand Down
10 changes: 3 additions & 7 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 0164bce

Please sign in to comment.