patch-2.1.127 linux/kernel/itimer.c

Next file: linux/kernel/ksyms.c
Previous file: linux/kernel/acct.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/kernel/itimer.c linux/kernel/itimer.c
@@ -102,11 +102,9 @@
 	send_sig(SIGALRM, p, 1);
 	interval = p->it_real_incr;
 	if (interval) {
-		unsigned long timeout = jiffies + interval;
-		/* check for overflow */
-		if (timeout < interval)
-			timeout = ULONG_MAX;
-		p->real_timer.expires = timeout;
+		if (interval > (unsigned long) LONG_MAX)
+			interval = LONG_MAX;
+		p->real_timer.expires = jiffies + interval;
 		add_timer(&p->real_timer);
 	}
 }
@@ -127,10 +125,9 @@
 			current->it_real_incr = i;
 			if (!j)
 				break;
+			if (j > (unsigned long) LONG_MAX)
+				j = LONG_MAX;
 			i = j + jiffies;
-			/* check for overflow.. */
-			if (i < j)
-				i = ULONG_MAX;
 			current->real_timer.expires = i;
 			add_timer(&current->real_timer);
 			break;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov