mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Subject: [patch] fix alarm() return value
Date: Mon, 30 Jan 2006 09:57:39 +0100	[thread overview]
Message-ID: <43DDD503.3060008@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

  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

-- 
Gerd 'just married' Hoffmann <kraxel@suse.de>
I'm the hacker formerly known as Gerd Knorr.
http://www.suse.de/~kraxel/just-married.jpeg

[-- Attachment #2: fix-146142 --]
[-- Type: text/plain, Size: 707 bytes --]

Index: linux-2.6.15/kernel/itimer.c
===================================================================
--- linux-2.6.15.orig/kernel/itimer.c	2006-01-27 16:11:33.000000000 +0100
+++ linux-2.6.15/kernel/itimer.c	2006-01-27 17:01:54.000000000 +0100
@@ -151,12 +151,12 @@ int do_setitimer(int which, struct itime
 	switch (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);

             reply	other threads:[~2006-01-30  8:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30  8:57 Gerd Hoffmann [this message]
2006-01-30  9:07 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43DDD503.3060008@suse.de \
    --to=kraxel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome