[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/14] proc: turn count_up and store_pid into normal functions
From: |
Justus Winter |
Subject: |
[PATCH 04/14] proc: turn count_up and store_pid into normal functions |
Date: |
Fri, 8 Nov 2013 21:24:12 +0100 |
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 | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/proc/mgt.c b/proc/mgt.c
index d7ad296..4da2216 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -514,6 +514,9 @@ S_proc_exception_raise (mach_port_t excport,
}
+static void count_up (struct proc *, void *);
+static void store_pid (struct proc *, void *);
+
/* Implement proc_getallpids as described in <hurd/process.defs>. */
kern_return_t
S_proc_getallpids (struct proc *p,
@@ -523,15 +526,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);
@@ -553,6 +547,18 @@ S_proc_getallpids (struct proc *p,
*pidslen = nprocs;
return 0;
}
+
+void
+count_up (struct proc *p, void *counter)
+{
+ ++*(int *)counter;
+}
+
+void
+store_pid (struct proc *p, void *loc)
+{
+ *(*(pid_t **)loc)++ = p->p_pid;
+}
/* Create a process for TASK, which is not otherwise known to us.
The PID/parentage/job-control fields are not yet filled in,
--
1.7.10.4
- [PATCH 01/14] term: fix error handling in hurdio_mdmctl, Justus Winter, 2013/11/08
- [PATCH 07/14] proc: fix the declaraton of genpid, Justus Winter, 2013/11/08
- [PATCH 11/14] auth: fix use of uninitialized variable err, Justus Winter, 2013/11/08
- [PATCH 10/14] init: fix memory leak, Justus Winter, 2013/11/08
- [PATCH 14/14] mach-defpager: remove unused variables, Justus Winter, 2013/11/08
- [PATCH 04/14] proc: turn count_up and store_pid into normal functions,
Justus Winter <=
- [PATCH 09/14] proc: fix error handling in S_proc_exception_raise, Justus Winter, 2013/11/08
- [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Justus Winter, 2013/11/08
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Ludovic Courtès, 2013/11/08
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Justus Winter, 2013/11/09
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Richard Braun, 2013/11/09
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Justus Winter, 2013/11/09
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Ludovic Courtès, 2013/11/09
- Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Samuel Thibault, 2013/11/09