patch-1.3.96 linux/fs/proc/mem.c

Next file: linux/fs/ufs/ufs_dir.c
Previous file: linux/fs/proc/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.95/linux/fs/proc/mem.c linux/fs/proc/mem.c
@@ -65,14 +65,9 @@
 		return -EINVAL;
 	pid = inode->i_ino;
 	pid >>= 16;
-	tsk = NULL;
-	for (i = 1 ; i < NR_TASKS ; i++)
-		if (task[i] && task[i]->pid == pid) {
-			tsk = task[i];
-			break;
-		}
-	if (!tsk)
+	if (pid != current->pid)
 		return -EACCES;
+	tsk = current;
 	addr = file->f_pos;
 	count = check_range(tsk, addr, count);
 	if (count < 0)
@@ -131,14 +126,9 @@
 	addr = file->f_pos;
 	pid = inode->i_ino;
 	pid >>= 16;
-	tsk = NULL;
-	for (i = 1 ; i < NR_TASKS ; i++)
-		if (task[i] && task[i]->pid == pid) {
-			tsk = task[i];
-			break;
-		}
-	if (!tsk)
+	if (pid != current->pid)
 		return -EACCES;
+	tsk = current;
 	tmp = buf;
 	while (count > 0) {
 		if (current->signal & ~current->blocked)

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