summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-02-27 18:54:04 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-02-27 18:54:04 +0000
commit7c268f49b35eb2efbe177771118085713f819b0a (patch)
treed7bcdb5456e88dac7999a1776640c42cfaa7f290 /memory
parent422d1c0eddd9894960bc5b1a248cbc357a1c1746 (diff)
downloadlibapr-7c268f49b35eb2efbe177771118085713f819b0a.tar.gz
A silly little patch - the uses of 'pid' as the apr_proc_t* name are really
confusing, proc is much more clearly not an actual int pid value. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64386 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r--memory/unix/apr_pools.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index a18fb1012..25ddbd9ef 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -439,7 +439,7 @@ typedef struct cleanup_t cleanup_t;
/** A list of processes */
struct process_chain {
/** The process ID */
- apr_proc_t *pid;
+ apr_proc_t *proc;
apr_kill_conditions_e kill_how;
/** The next process in the list */
struct process_chain *next;
@@ -2026,12 +2026,12 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data)
* we might want to fold support for that into the generic interface.
* For now, it's a special case.
*/
-APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid,
+APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *proc,
apr_kill_conditions_e how)
{
struct process_chain *pc = apr_palloc(pool, sizeof(struct process_chain));
- pc->pid = pid;
+ pc->proc = proc;
pc->kill_how = how;
pc->next = pool->subprocesses;
pool->subprocesses = pc;
@@ -2060,7 +2060,7 @@ static void free_proc_chain(struct process_chain *procs)
#ifndef NEED_WAITPID
/* Pick up all defunct processes */
for (pc = procs; pc; pc = pc->next) {
- if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE)
+ if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE)
pc->kill_how = APR_KILL_NEVER;
}
#endif /* !defined(NEED_WAITPID) */
@@ -2077,12 +2077,12 @@ static void free_proc_chain(struct process_chain *procs)
#ifdef WIN32
need_timeout = 1;
#else /* !defined(WIN32) */
- if (apr_proc_kill(pc->pid, SIGTERM) == APR_SUCCESS)
+ if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS)
need_timeout = 1;
#endif /* !defined(WIN32) */
}
else if (pc->kill_how == APR_KILL_ALWAYS) {
- apr_proc_kill(pc->pid, SIGKILL);
+ apr_proc_kill(pc->proc, SIGKILL);
}
}
@@ -2099,7 +2099,8 @@ static void free_proc_chain(struct process_chain *procs)
need_timeout = 0;
for (pc = procs; pc; pc = pc->next) {
if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) {
- if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) == APR_CHILD_NOTDONE)
+ if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT)
+ == APR_CHILD_NOTDONE)
need_timeout = 1; /* subprocess is still active */
else
pc->kill_how = APR_KILL_NEVER; /* subprocess has exited */
@@ -2121,13 +2122,13 @@ static void free_proc_chain(struct process_chain *procs)
*/
for (pc = procs; pc; pc = pc->next) {
if (pc->kill_how == APR_KILL_AFTER_TIMEOUT)
- apr_proc_kill(pc->pid, SIGKILL);
+ apr_proc_kill(pc->proc, SIGKILL);
}
/* Now wait for all the signaled processes to die */
for (pc = procs; pc; pc = pc->next) {
if (pc->kill_how != APR_KILL_NEVER)
- (void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT);
+ (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT);
}
#ifdef WIN32
@@ -2139,9 +2140,9 @@ static void free_proc_chain(struct process_chain *procs)
*/
{
for (pc = procs; pc; pc = pc->next) {
- if (pc->pid->hproc) {
- CloseHandle(pc->pid->hproc);
- pc->pid->hproc = NULL;
+ if (pc->proc->hproc) {
+ CloseHandle(pc->proc->hproc);
+ pc->proc->hproc = NULL;
}
}
}