patch-2.0.1 linux/kernel/fork.c

Next file: linux/kernel/sched.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/kernel/fork.c linux/kernel/fork.c
@@ -34,7 +34,6 @@
 static inline int find_empty_process(void)
 {
 	int i;
-	struct task_struct *p;
 
 	if (nr_tasks >= NR_TASKS - MIN_TASKS_LEFT_FOR_ROOT) {
 		if (current->uid)
@@ -43,7 +42,9 @@
 	if (current->uid) {
 		long max_tasks = current->rlim[RLIMIT_NPROC].rlim_cur;
 
+		max_tasks--;	/* count the new process.. */
 		if (max_tasks < nr_tasks) {
+			struct task_struct *p;
 			for_each_task (p) {
 				if (p->uid == current->uid)
 					if (--max_tasks < 0)

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