From fefec20e6b14b5d9d661131b3ba3d43f40cc1590 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sat, 5 Sep 2015 18:21:53 +0200 Subject: [PATCH] procfs: do not list init in /proc/services It is not a system service. Change-Id: Ibfbf08aa52095826c19172e517bcbd292e7944a0 --- minix/fs/procfs/service.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/minix/fs/procfs/service.c b/minix/fs/procfs/service.c index a7ed9eba9..e9f88496c 100644 --- a/minix/fs/procfs/service.c +++ b/minix/fs/procfs/service.c @@ -163,8 +163,13 @@ static int service_active(index_t slot) { + /* + * Init is in RS's process tables as the representation of user + * processes. It is not a system service. + */ return ((rproc.proc[slot].r_flags & (RS_IN_USE | RS_ACTIVE)) == - (RS_IN_USE | RS_ACTIVE)); + (RS_IN_USE | RS_ACTIVE) && + rproc.pub[slot].endpoint != INIT_PROC_NR); } /* -- 2.44.0