Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Neither 'cherokee' nor 'cherokee-worker' returned a error on the

process retcode when the initialization failed.

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6876 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
commit 2c8bc6f16534454558295be3dd73de1901afe045 1 parent 030c268
@alobbs alobbs authored
Showing with 21 additions and 9 deletions.
  1. +4 −3 cherokee/macros.h
  2. +4 −0 cherokee/main.c
  3. +13 −6 cherokee/main_worker.c
View
7 cherokee/macros.h
@@ -115,9 +115,10 @@
#define FD_NUM_MIN_PER_THREAD 8 /* range: 8 ... 65000 */
#define FD_NUM_CUSTOM_LIMIT 4096 /* range: 16 ... 65000 */
-#define EXIT_OK 0
-#define EXIT_ERROR 1
-#define EXIT_OK_ONCE 2
+#define EXIT_OK 0
+#define EXIT_ERROR 1
+#define EXIT_OK_ONCE 2
+#define EXIT_ERROR_FATAL 3
#if (FD_NUM_MIN_SYSTEM < 16)
# error FD_NUM_MIN_SYSTEM too low, < 16
View
4 cherokee/main.c
@@ -875,6 +875,10 @@ process_wait (pid_t pid)
if (re == EXIT_OK_ONCE) {
clean_up();
exit (EXIT_OK);
+
+ } else if (re == EXIT_ERROR_FATAL) {
+ clean_up();
+ exit (EXIT_ERROR);
}
/* Child terminated normally */
View
19 cherokee/main_worker.c
@@ -361,11 +361,14 @@ main (int argc, char **argv)
cherokee_init();
ret = cherokee_server_new (&srv);
- if (ret < ret_ok) return 1;
+ if (ret < ret_ok) {
+ exit (EXIT_ERROR_FATAL);
+ }
ret = process_parameters (argc, argv);
- if (ret != ret_ok)
- exit (EXIT_OK_ONCE);
+ if (ret != ret_ok) {
+ exit (EXIT_ERROR_FATAL);
+ }
if (print_modules) {
cherokee_info_build_print (srv);
@@ -374,13 +377,16 @@ main (int argc, char **argv)
if (just_test) {
ret = test_configuration_file();
- if (ret != ret_ok)
- exit(EXIT_ERROR);
+ if (ret != ret_ok) {
+ exit (EXIT_ERROR);
+ }
exit (EXIT_OK_ONCE);
}
ret = common_server_initialization (srv);
- if (ret < ret_ok) return 2;
+ if (ret < ret_ok) {
+ exit (EXIT_ERROR_FATAL);
+ }
do {
ret = cherokee_server_step (srv);
@@ -391,5 +397,6 @@ main (int argc, char **argv)
free (config_file);
cherokee_mrproper();
+
return EXIT_OK;
}
Please sign in to comment.
Something went wrong with that request. Please try again.