patch-2.1.8 linux/kernel/sched.c
Next file: linux/kernel/sysctl.c
Previous file: linux/kernel/module.c
Back to the patch index
Back to the overall index
-  Lines: 31
-  Date:
Thu Nov  7 16:08:32 1996
-  Orig file: 
v2.1.7/linux/kernel/sched.c
-  Orig date: 
Tue Oct 29 19:58:48 1996
diff -u --recursive --new-file v2.1.7/linux/kernel/sched.c linux/kernel/sched.c
@@ -1192,20 +1192,19 @@
 
 #endif
 
-static struct task_struct *find_process_by_pid(pid_t pid) {
-	struct task_struct *p, *q;
+static struct task_struct *find_process_by_pid(pid_t pid)
+{
+	struct task_struct *p;
 
-	if (pid == 0)
-		p = current;
-	else {
-		p = 0;
-		for_each_task(q) {
-			if (q && q->pid == pid) {
-				p = q;
-				break;
-			}
+	p = current;
+	if (pid) {
+		for_each_task(p) {
+			if (p->pid == pid)
+				goto found;
 		}
+		p = NULL;
 	}
+found:
 	return p;
 }
 
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov