include_cmd_arg arg;
BUFF *script_in;
ap_procattr_t *procattr;
- ap_proc_t *procnew;
+ ap_proc_t procnew;
ap_status_t rc;
ap_table_t *env = r->subprocess_env;
char **argv;
"couldn't create child process: %d: %s", rc, s);
}
else {
- ap_note_subprocess(r->pool, procnew, kill_after_timeout);
+ ap_note_subprocess(r->pool, &procnew, kill_after_timeout);
/* Fill in BUFF structure for parents pipe to child's stdout */
- ap_get_childout(&file, procnew);
+ file = procnew.stdout;
iol = ap_create_file_iol(file);
if (!iol)
return APR_EBADF;
{
char **env;
ap_procattr_t *procattr;
- ap_proc_t *procnew;
+ ap_proc_t procnew;
ap_status_t rc = APR_SUCCESS;
ap_file_t *file = NULL;
ap_iol *iol;
"couldn't create child process: %d: %s", rc, r->filename);
}
else {
- ap_note_subprocess(p, procnew, kill_after_timeout);
+ ap_note_subprocess(p, &procnew, kill_after_timeout);
/* Fill in BUFF structure for parents pipe to child's stdout */
- ap_get_childout(&file, procnew);
+ file = procnew.stdout;
iol = ap_create_file_iol(file);
if (!iol)
return APR_EBADF;
ap_bsetopt(*script_in, BO_TIMEOUT, &r->server->timeout);
/* Fill in BUFF structure for parents pipe to child's stdin */
- ap_get_childin(&file, procnew);
+ file = procnew.stdin;
iol = ap_create_file_iol(file);
if (!iol)
return APR_EBADF;
ap_bsetopt(*script_out, BO_TIMEOUT, &r->server->timeout);
/* Fill in BUFF structure for parents pipe to child's stderr */
- ap_get_childerr(&file, procnew);
+ file = procnew.stderr;
iol = ap_create_file_iol(file);
if (!iol)
return APR_EBADF;
*/
int rc = -1;
ap_procattr_t *procattr;
- ap_proc_t *procnew;
+ ap_proc_t procnew;
#ifdef SIGHUP
/* No concept of a child process on Win32 */
rc = ap_create_process(&procnew, pname, args, NULL, procattr, p);
if (rc == APR_SUCCESS) {
- ap_note_subprocess(p, procnew, kill_after_timeout);
- ap_get_childin(fpin, procnew);
+ ap_note_subprocess(p, &procnew, kill_after_timeout);
+ (*fpin) = procnew.stdin;
}
}
{
int rc;
ap_procattr_t *procattr;
- ap_proc_t *procnew;
+ ap_proc_t procnew;
#ifdef SIGHUP
ap_signal(SIGHUP, SIG_IGN);
/* I am assuming that if ap_create_process was */
/* successful that the child is running. */
RAISE_SIGSTOP(PIPED_LOG_SPAWN);
- pl->pid = procnew;
- ap_register_other_child(procnew, piped_log_maintenance, pl,
+ pl->pid = &procnew;
+ ap_register_other_child(&procnew, piped_log_maintenance, pl,
ap_piped_log_write_fd(pl), pl->p);
}
}
static int find_child_by_pid(ap_proc_t *pid)
{
int i;
- int actual_pid;
- ap_get_os_proc(&actual_pid, pid);
for (i = 0; i < ap_max_daemons_limit; ++i)
- if (ap_scoreboard_image->parent[i].pid == actual_pid)
+ if (ap_scoreboard_image->parent[i].pid == pid->pid)
return i;
return -1;
}
-static void process_child_status(ap_proc_t *abs_pid, ap_wait_t status)
+static void process_child_status(ap_proc_t *pid, ap_wait_t status)
{
- int pid;
- ap_get_os_proc(&pid, abs_pid);
/* Child died... if it died due to a fatal error,
* we should simply bail out.
*/
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
"Child %d returned a Fatal error... \n"
"Apache is exiting!",
- pid);
+ pid->pid);
exit(APEXIT_CHILDFATAL);
}
if (WIFSIGNALED(status)) {
0, ap_server_conf,
"child pid %d exit signal %s (%d), "
"possible coredump in %s",
- pid, (WTERMSIG(status) >= NumSIG) ? "" :
+ pid->pid, (WTERMSIG(status) >= NumSIG) ? "" :
SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
ap_coredump_dir);
}
#endif
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
0, ap_server_conf,
- "child pid %d exit signal %s (%d)", pid,
+ "child pid %d exit signal %s (%d)", pid->pid,
SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
#ifdef WCOREDUMP
}
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
ap_server_conf,
"child pid %d exit signal %d",
- pid, WTERMSIG(status));
+ pid->pid, WTERMSIG(status));
#endif
}
}
* scoreboard. Somehow we don't know about this
* child.
*/
- ap_os_proc_t os_pid;
-
- ap_get_os_proc(&os_pid, pid);
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
0, ap_server_conf,
- "long lost child came home! (pid %d)", os_pid);
+ "long lost child came home! (pid %d)", pid->pid);
}
/* Don't perform idle maintenance when a child dies,
* only do it when there's a timeout. Remember only a
{
struct timeval tv;
ap_status_t rv;
- ap_proc_t *ret = NULL;
+ ap_proc_t *ret;
++wait_or_timeout_counter;
if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
ap_probe_writable_fds();
#endif
}
- rv = ap_wait_all_procs(&ret, status, APR_NOWAIT, p);
+ rv = ap_wait_all_procs(ret, status, APR_NOWAIT, p);
if (ap_canonical_error(rv) == APR_EINTR) {
return NULL;
}