
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Fix do_setitimer for ITIMER_VIRTUAL and ITIMER_PROF.  Non-zero
it_virt_value and it_prof_value needs to get increamented by one jiffies. 
Applications like konqueror depend on this behaviour.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/kernel/itimer.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -puN kernel/itimer.c~cputime-fix-do_setitimer kernel/itimer.c
--- 25/kernel/itimer.c~cputime-fix-do_setitimer	Wed Nov  3 15:23:44 2004
+++ 25-akpm/kernel/itimer.c	Wed Nov  3 15:23:44 2004
@@ -102,16 +102,18 @@ int do_setitimer(int which, struct itime
 			break;
 		case ITIMER_VIRTUAL:
 			cputime = timeval_to_cputime(&value->it_value);
-			if (cputime_eq(cputime, cputime_zero))
-				cputime = jiffies_to_cputime(1);
+			if (cputime_gt(cputime, cputime_zero))
+				cputime = cputime_add(cputime,
+						      jiffies_to_cputime(1));
 			current->it_virt_value = cputime;
 			cputime = timeval_to_cputime(&value->it_interval);
 			current->it_virt_incr = cputime;
 			break;
 		case ITIMER_PROF:
 			cputime = timeval_to_cputime(&value->it_value);
-			if (cputime_eq(cputime, cputime_zero))
-				cputime = jiffies_to_cputime(1);
+			if (cputime_gt(cputime, cputime_zero))
+				cputime = cputime_add(cputime,
+						      jiffies_to_cputime(1));
 			current->it_prof_value = cputime;
 			cputime = timeval_to_cputime(&value->it_interval);
 			current->it_prof_incr = cputime;
_
