* null terminated strings.
*/
_putenv(apr_psprintf(p,"AP_PARENT_PID=%i", parent_pid));
- _putenv(apr_psprintf(p,"AP_MY_GENERATION=%i", ap_my_generation));
i = 0;
iEnvBlockLen = 1;
CloseHandle(hShareError);
}
_putenv("AP_PARENT_PID=");
- _putenv("AP_MY_GENERATION=");
if (!rv) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf,
ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), s,
"ResetEvent(shutdown_event)");
}
-
}
else if (cld == RESTART_HANDLE) {
/* Received a restart event. Prepare the restart_event to be reused
*/
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
- ++ap_my_generation;
}
else {
/* The child process exited prematurely due to a fatal error. */
}
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
+ }
+ if (restart_pending) {
++ap_my_generation;
+ ap_scoreboard_image->global->running_generation = ap_my_generation;
}
-
die_now:
if (shutdown_pending)
{
/* Set up the listeners */
get_listeners_from_parent(s);
- ap_my_generation = atoi(getenv("AP_MY_GENERATION"));
-
+ ap_my_generation = ap_scoreboard_image->global->running_generation;
rv = apr_proc_mutex_child_init(&start_mutex, signal_name_prefix,
s->process->pool);
}