diff options
author | Eric Covener <covener@apache.org> | 2010-11-29 01:10:22 +0100 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2010-11-29 01:10:22 +0100 |
commit | d185fd5f57ea4d81d0acc7a9ee373b714c57a761 (patch) | |
tree | af3eb5e9af7aa310c060dfa26171ee827c04b668 /server/mpm_unix.c | |
parent | Fix description of "note" (diff) | |
download | apache2-d185fd5f57ea4d81d0acc7a9ee373b714c57a761.tar.xz apache2-d185fd5f57ea4d81d0acc7a9ee373b714c57a761.zip |
PR50350: When no -k option is provided on the httpd command line, the server
was starting without checking for an existing pidfile.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm_unix.c')
-rw-r--r-- | server/mpm_unix.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/mpm_unix.c b/server/mpm_unix.c index 81abbb1a2a..c0620191cb 100644 --- a/server/mpm_unix.c +++ b/server/mpm_unix.c @@ -610,6 +610,7 @@ void ap_mpm_pod_killpg(ap_pod_t *pod, int num) } static const char *dash_k_arg = NULL; +static const char *dash_k_arg_noarg = "noarg"; static int send_signal(pid_t pid, int sig) { @@ -656,7 +657,7 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf) } } - if (!strcmp(dash_k_arg, "start")) { + if (!strcmp(dash_k_arg, "start") || dash_k_arg == dash_k_arg_noarg) { if (running) { printf("%s\n", status); return 1; @@ -755,10 +756,12 @@ void ap_mpm_rewrite_args(process_rec *process) process->argc = mpm_new_argv->nelts; process->argv = (const char * const *)mpm_new_argv->elts; - - if (dash_k_arg) { - APR_REGISTER_OPTIONAL_FN(ap_signal_server); + + if (NULL == dash_k_arg) { + dash_k_arg = dash_k_arg_noarg; } + + APR_REGISTER_OPTIONAL_FN(ap_signal_server); } static pid_t parent_pid, my_pid; |