diff options
author | Andris Zeila <andris.zeila@zabbix.com> | 2021-09-27 13:46:43 +0300 |
---|---|---|
committer | Andris Zeila <andris.zeila@zabbix.com> | 2021-09-27 13:47:24 +0300 |
commit | dfc10c0da837fcecb89011a85a6c4346eca80546 (patch) | |
tree | 2b31a464f87179d4c5d1161511e44dde4e5ba613 /include/daemon.h | |
parent | 28bd91a809c6cd9329b72b1ef79e4e869aeac18a (diff) |
...G...PS. [ZBXNEXT-6923] moved zb_on_exit() call outside signal handler
Diffstat (limited to 'include/daemon.h')
-rw-r--r-- | include/daemon.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/daemon.h b/include/daemon.h index 0240e362094..1c3b6aa3ad7 100644 --- a/include/daemon.h +++ b/include/daemon.h @@ -28,15 +28,24 @@ extern char *CONFIG_PID_FILE; extern volatile sig_atomic_t sig_exiting; #include "threads.h" +#define ZBX_EXIT_NONE 0 +#define ZBX_EXIT_SUCCESS 1 +#define ZBX_EXIT_FAILURE 2 + int daemon_start(int allow_root, const char *user, unsigned int flags); void daemon_stop(void); int zbx_sigusr_send(int flags); void zbx_set_sigusr_handler(void (*handler)(int flags)); -#define ZBX_IS_RUNNING() (0 == sig_exiting) +#define ZBX_IS_RUNNING() (ZBX_EXIT_NONE == sig_exiting) +#define ZBX_EXIT_STATUS() (ZBX_EXIT_SUCCESS == sig_exiting ? SUCCEED : FAIL) + #define ZBX_DO_EXIT() + + + #define START_MAIN_ZABBIX_ENTRY(allow_root, user, flags) daemon_start(allow_root, user, flags) #endif /* ZABBIX_DAEMON_H */ |