summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-06 13:14:30 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-10 16:33:35 +0100
commit5d255e321ace772df825d4ac2604b451bde7ba15 (patch)
tree5344789ba5f366a55f254428e4fe68f617558b46 /proc
parentaaba23a7f450d43d0062d66a712e5d0de62f7e87 (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.c23
1 files changed, 14 insertions, 9 deletions
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 <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);