Permalink
Browse files

There were times when 'cherokee' was not returning the right retcode.

It fixes bug #1223: http://bugs.cherokee-project.com/1223

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6763 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent d811380 commit 0d5241b16e12926798216a6a39e75558a988a57f @alobbs alobbs committed Jun 23, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 cherokee/main.c
View
@@ -80,6 +80,7 @@ union semun {
pid_t pid;
char *worker_uid;
+int worker_retcode;
cherokee_boolean_t graceful_restart;
char *cherokee_worker;
char *pid_file_path = NULL;
@@ -877,6 +878,7 @@ process_wait (pid_t pid)
/* Child terminated normally */
PRINT_MSG ("PID %d: exited re=%d\n", pid, re);
if (re != 0) {
+ worker_retcode = re;
return ret_error;
}
}
@@ -885,6 +887,7 @@ process_wait (pid_t pid)
PRINT_MSG ("PID %d: received a signal=%d\n", pid, WTERMSIG(exitcode));
}
+ worker_retcode = 0;
return ret_ok;
}
@@ -1095,6 +1098,7 @@ main (int argc, char *argv[])
use_valgrind = figure_use_valgrind (argc, argv);
pid_file_path = figure_pid_file_path (config_file_path);
worker_uid = figure_worker_uid (config_file_path);
+ worker_retcode = -1;
/* Turn into a daemon
*/
@@ -1136,5 +1140,5 @@ main (int argc, char *argv[])
clean_up();
}
- return EXIT_OK;
+ return (worker_retcode == 0) ? EXIT_OK : EXIT_ERROR;
}

0 comments on commit 0d5241b

Please sign in to comment.