wrowe 2003/02/27 10:54:05
Modified: memory/unix apr_pools.c
Log:
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.
Revision Changes Path
1.193 +13 -12 apr/memory/unix/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -r1.192 -r1.193
--- apr_pools.c 1 Jan 2003 00:01:51 -0000 1.192
+++ apr_pools.c 27 Feb 2003 18:54:04 -0000 1.193
@@ -439,7 +439,7 @@
/** 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 @@
* 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 @@
#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 @@
#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 @@
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 @@
*/
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 @@
*/
{
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;
}
}
}