patch-1.3.11 linux/kernel/itimer.c

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

diff -u --recursive --new-file v1.3.10/linux/kernel/itimer.c linux/kernel/itimer.c
@@ -71,6 +71,17 @@
 	return 0;
 }
 
+void it_real_fn(unsigned long __data)
+{
+	struct task_struct * p = (struct task_struct *) __data;
+
+	send_sig(SIGALRM, p, 1);
+	if (p->it_real_incr) {
+		p->real_timer.expires = p->it_real_incr;
+		add_timer(&p->real_timer);
+	}
+}
+
 int _setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
 {
 	register unsigned long i, j;
@@ -82,10 +93,10 @@
 		return k;
 	switch (which) {
 		case ITIMER_REAL:
+			del_timer(&current->real_timer);
 			if (j) {
-				j += 1+itimer_ticks;
-				if (j < itimer_next)
-					itimer_next = j;
+				current->real_timer.expires = j;
+				add_timer(&current->real_timer);
 			}
 			current->it_real_value = j;
 			current->it_real_incr = i;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this