summaryrefslogtreecommitdiffstats
path: root/server/main.c
diff options
context:
space:
mode:
authorIan Holsman <ianh@apache.org>2001-11-23 17:35:22 +0100
committerIan Holsman <ianh@apache.org>2001-11-23 17:35:22 +0100
commit86b792b21c8bdab5ef9416d1bef14f849ad8f702 (patch)
tree0325a6668e30c94aad21e0e7f0ecba9e00194ee0 /server/main.c
parentmake doxygen stop complianing about some netware specific C calls (diff)
downloadapache2-86b792b21c8bdab5ef9416d1bef14f849ad8f702.tar.xz
apache2-86b792b21c8bdab5ef9416d1bef14f849ad8f702.zip
Modify post_config hook so that it can return a error,
causing the server not to start. previous method was to call exit(1) which would not fail gracefully PR: Obtained from: Submitted by: Reviewed by: (Idea only Jeff Trawick) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92144 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/main.c')
-rw-r--r--server/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/main.c b/server/main.c
index 9aa11f640c..9e279419ec 100644
--- a/server/main.c
+++ b/server/main.c
@@ -397,7 +397,10 @@ int main(int argc, const char * const argv[])
}
apr_pool_clear(plog);
ap_run_open_logs(pconf, plog, ptemp, server_conf);
- ap_run_post_config(pconf, plog, ptemp, server_conf);
+ if ( ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Configuration Failed\n");
+ destroy_and_exit_process(process, 1);
+ }
apr_pool_destroy(ptemp);
for (;;) {
@@ -423,7 +426,10 @@ int main(int argc, const char * const argv[])
apr_sort_hooks();
apr_pool_clear(plog);
ap_run_open_logs(pconf, plog, ptemp, server_conf);
- ap_run_post_config(pconf, plog, ptemp, server_conf);
+ if (ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR | APLOG_NOERRNO, 0, NULL, "Configuration Failed\n");
+ destroy_and_exit_process(process, 1);
+ }
apr_pool_destroy(ptemp);
apr_pool_lock(pconf, 1);