Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Oct 2000 15:21:46 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        void <float@firedrake.org>
Cc:        Chris Costello <chris@calldei.com>, hackers@FreeBSD.ORG
Subject:   Re: "find /proc"
Message-ID:  <20001005152146.L27736@fw.wintelcom.net>
In-Reply-To: <20001005231053.A28010@firedrake.org>; from float@firedrake.org on Thu, Oct 05, 2000 at 11:10:53PM %2B0100
References:  <20001005215918.A24987@firedrake.org> <20001005165749.D26550@holly.calldei.com> <20001005231053.A28010@firedrake.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* void <float@firedrake.org> [001005 15:11] wrote:
> On Thu, Oct 05, 2000 at 04:57:50PM -0500, Chris Costello wrote:
> > On Thursday, October 05, 2000, void wrote:
> > > Why does find(1) operate non-recursively in /proc?
> > 
> >    Because the procfs_readdir() code does not report directories
> > as the correct type (DT_REG as opposed to the proper DT_DIR).
> 
> Sounds like a bug, do you think I should submit a PR?

No, try this:


Index: procfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/miscfs/procfs/procfs_vnops.c,v
retrieving revision 1.76.2.1
diff -u -u -r1.76.2.1 procfs_vnops.c
--- procfs_vnops.c	2000/06/21 09:33:43	1.76.2.1
+++ procfs_vnops.c	2000/10/05 22:19:41
@@ -901,7 +901,7 @@
 				dp->d_fileno = PROCFS_FILENO(p->p_pid, Pproc);
 				dp->d_namlen = sprintf(dp->d_name, "%ld",
 				    (long)p->p_pid);
-				dp->d_type = DT_REG;
+				dp->d_type = DT_DIR;
 				p = p->p_list.le_next;
 				break;
 			}



Thanks Chris.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001005152146.L27736>