From 5d255e321ace772df825d4ac2604b451bde7ba15 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 6 Nov 2013 13:14:30 +0100 Subject: proc: turn count_up and store_pid into normal functions Previously count_up and store_pid were defined inside S_proc_getallpids. Move them out of that function and declare them static. * proc/mgt.c: Turn count_up and store_pid into normal functions. --- proc/mgt.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'proc/mgt.c') diff --git a/proc/mgt.c b/proc/mgt.c index 5db1fe8c..11b2f397 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -516,6 +516,20 @@ S_proc_exception_raise (mach_port_t excport, } +/* This function is used as callback in S_proc_getallpids. */ +static void +count_up (struct proc *p, void *counter) +{ + ++*(int *)counter; +} + +/* This function is used as callback in S_proc_getallpids. */ +static void +store_pid (struct proc *p, void *loc) +{ + *(*(pid_t **)loc)++ = p->p_pid; +} + /* Implement proc_getallpids as described in . */ kern_return_t S_proc_getallpids (struct proc *p, @@ -525,15 +539,6 @@ S_proc_getallpids (struct proc *p, int nprocs; pid_t *loc; - void count_up (struct proc *p, void *counter) - { - ++*(int *)counter; - } - void store_pid (struct proc *p, void *loc) - { - *(*(pid_t **)loc)++ = p->p_pid; - } - /* No need to check P here; we don't use it. */ add_tasks (0); -- cgit v1.2.3