Re: Make procfs root listing work again

2014-08-27 Thread Philip Guenther
On Wed, Aug 20, 2014 at 5:23 AM, Visa Hankala v...@hankala.org wrote:

 On Tue, Aug 19, 2014 at 10:14:59PM -0700, Philip Guenther wrote:
  Can you describe what you're using that needs it?

 Well, I am not using it. The code has not been sent to the Attic yet and
 I happened to take a look at it. That is all.


So, broken for 5.5, disabled for 5.6, and no one has said I'm using this
in 5.4 for details, help!  Maybe I'll fire up my tedu keyboard
(manufactured by Stihl) this weekend...


Philip Guenther


Re: Make procfs root listing work again

2014-08-20 Thread Visa Hankala
On Tue, Aug 19, 2014 at 10:14:59PM -0700, Philip Guenther wrote:
 Can you describe what you're using that needs it?

Well, I am not using it. The code has not been sent to the Attic yet and
I happened to take a look at it. That is all.



Make procfs root listing work again

2014-08-19 Thread Visa Hankala
Hello,

This patch corrects the process iterator in procfs_readdir(), allowing
procfs root listing to work again. The iterator was stuck to the first
instance of allprocess list because all the relevant LIST_NEXT()
statements were mistakenly removed in revision 1.58 of procfs_vnops.c.

Regards,
Visa Hankala


Index: sys/miscfs/procfs/procfs_vnops.c
===
RCS file: /cvs/src/sys/miscfs/procfs/procfs_vnops.c,v
retrieving revision 1.60
diff -N -u -p sys/miscfs/procfs/procfs_vnops.c
--- sys/miscfs/procfs/procfs_vnops.c8 Jul 2014 17:19:25 -   1.60
+++ sys/miscfs/procfs/procfs_vnops.c19 Aug 2014 13:54:11 -
@@ -909,18 +909,24 @@ procfs_readdir(void *v)
/* fall through */
 
default:
-   while (pcnt  i)
+   while (pcnt  i) {
pcnt++;
+   pr = LIST_NEXT(pr, ps_list);
+   if (pr == NULL)
+   goto done;
+   }
d.d_fileno = PROCFS_FILENO(pr-ps_pid, Pproc);
d.d_namlen = snprintf(d.d_name, 
sizeof(d.d_name),
%ld, (long)pr-ps_pid);
d.d_type = DT_REG;
+   pr = LIST_NEXT(pr, ps_list);
break;
}
 
if ((error = uiomove(d, UIO_MX, uio)) != 0)
break;
}
+   done:
 #ifdef PROCFS_ZOMBIE
if (pr == NULL  doingzomb == 0) {
doingzomb = 1;