patch-2.3.10 linux/fs/proc/fd.c

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

diff -u --recursive --new-file v2.3.9/linux/fs/proc/fd.c linux/fs/proc/fd.c
@@ -104,7 +104,7 @@
 	read_lock(&tasklist_lock);
 	file = NULL;
 	p = find_task_by_pid(pid);
-	if (p)
+	if (p && p->files)
 		file = fcheck_task(p, fd);
 	read_unlock(&tasklist_lock);
 
@@ -114,7 +114,7 @@
 	 *	is NULL
 	 */
 
-	if (!file || !file->f_dentry)
+	if (!file)
 		goto out;
 
 	ino = (pid << 16) + PROC_PID_FD_DIR + fd;
@@ -161,10 +161,9 @@
 
 	for (fd -= 2 ; p->files && fd < p->files->max_fds; fd++, filp->f_pos++)
 	{
-		struct file * file = fcheck_task(p, fd);
 		unsigned int i,j;
 
-		if (!file || !file->f_dentry)
+		if (!fcheck_task(p, fd))
 			continue;
 
 		j = NUMBUF;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)