diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-06 13:14:30 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-10 16:33:35 +0100 |
commit | 5d255e321ace772df825d4ac2604b451bde7ba15 (patch) | |
tree | 5344789ba5f366a55f254428e4fe68f617558b46 /proc | |
parent | aaba23a7f450d43d0062d66a712e5d0de62f7e87 (diff) |
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.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/mgt.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -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 <hurd/process.defs>. */ 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); |