diff --git a/src/connection_pool.h b/src/connection_pool.h index 81e12ca..ea0c8c4 100644 --- a/src/connection_pool.h +++ b/src/connection_pool.h @@ -75,7 +75,7 @@ typedef struct tagConnectionPool { int max_count_per_entry; //0 means no limit /* - connections whose the idle time exceeds this time will be closed + connections whose idle time exceeds this time will be closed unit: second */ int max_idle_time; diff --git a/src/process_ctrl.c b/src/process_ctrl.c index c16871e..ce05be4 100644 --- a/src/process_ctrl.c +++ b/src/process_ctrl.c @@ -112,7 +112,7 @@ static int do_stop(const char *pidFilename, const bool bShowError, pid_t *pid) } } -int process_stop(const char *pidFilename) +int process_stop_ex(const char *pidFilename, const bool bShowError) { #define MAX_WAIT_COUNT 300 pid_t pid; @@ -120,7 +120,7 @@ int process_stop(const char *pidFilename) int sig; int i; - if ((result=do_stop(pidFilename, true, &pid)) != 0) { + if ((result=do_stop(pidFilename, bShowError, &pid)) != 0) { return result; } @@ -148,9 +148,10 @@ int process_stop(const char *pidFilename) int process_restart(const char *pidFilename) { + const bool bShowError = false; int result; - result = process_stop(pidFilename); + result = process_stop_ex(pidFilename, bShowError); if (result == ENOENT || result == ESRCH) { result = 0; } else if (result == 0) { @@ -328,6 +329,7 @@ int get_base_path_from_conf_file(const char *filename, char *base_path, int process_action(const char *pidFilename, const char *action, bool *stop) { + const bool bShowError = true; *stop = false; if (action == NULL) { @@ -337,7 +339,7 @@ int process_action(const char *pidFilename, const char *action, bool *stop) if (strcmp(action, "stop") == 0) { *stop = true; - return process_stop(pidFilename); + return process_stop_ex(pidFilename, bShowError); } else if (strcmp(action, "restart") == 0) { diff --git a/src/process_ctrl.h b/src/process_ctrl.h index 6f44fd7..105bf55 100644 --- a/src/process_ctrl.h +++ b/src/process_ctrl.h @@ -36,7 +36,9 @@ int write_to_pid_file(const char *pidFilename); int delete_pid_file(const char *pidFilename); -int process_stop(const char *pidFilename); +int process_stop_ex(const char *pidFilename, const bool bShowError); + +#define process_stop(pidFilename) process_stop_ex(pidFilename, true) int process_restart(const char *pidFilename);