fix alarm() return value
PATCH 1/1 fix alarm() return value
Hi folks,
This patch fixes the alarm() system call return value. The alarm(2) syscall is supposed to return the reamining seconds. The hrtimer switchover broke this because the code tries to gather the remaining time _after_ canceling the timer. Trivial fix below.
Please apply,
Gerd
Signature · 3 lines
Gerd 'just married' Hoffmann <[email protected]> I'm the hacker formerly known as Gerd Knorr. http://www.suse.de/~kraxel/just-married.jpeg
kernel/itimer.c +1 -1
@@ -151,12 +151,12 @@ int do_setitimer(int which, struct itimeswitch (which) {case ITIMER_REAL : timer = &tsk->signal->real_timer; -hrtimer_cancel (timer);if (ovalue) { ovalue->it_value =itimer_get_remtime (timer); ovalue->it_interval =ktime_to_timeval (tsk->signal->it_real_incr); } +hrtimer_cancel (timer); tsk->signal->it_real_incr =timeval_to_ktime (value->it_interval); expires =timeval_to_ktime (value->it_value);
Quoted 6 lines · Gerd Hoffmann
Hi folks,
This patch fixes the
alarm()system call return value. The alarm(2) syscall is supposed to return the reamining seconds. The hrtimer switchover broke this because the code tries to gather the remaining time _after_ canceling the timer. Trivial fix below.
Thanks. The fix is already in -mm and scheduled to go into 2.6.16
tglx