diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2022-05-06 11:24:11 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2022-05-06 11:24:11 +0300 |
commit | ce007973a48089398bc587fef15c4bf04a459e30 (patch) | |
tree | b24e74d6fe6825d1069aca777226074833c78c4a /src/zabbix_agent/zabbix_agentd.c | |
parent | e6dd7ab9f66c2d173e3e4a3e330242f52a3b2cf5 (diff) |
.......... [DEV-2132] applied suggested patch to make zbx_on_exit() static
Diffstat (limited to 'src/zabbix_agent/zabbix_agentd.c')
-rw-r--r-- | src/zabbix_agent/zabbix_agentd.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/zabbix_agent/zabbix_agentd.c b/src/zabbix_agent/zabbix_agentd.c index 5949b3ed41a..8d19a8cfd69 100644 --- a/src/zabbix_agent/zabbix_agentd.c +++ b/src/zabbix_agent/zabbix_agentd.c @@ -1045,6 +1045,26 @@ static int zbx_exec_service_task(const char *name, const ZBX_TASK_EX *t) } #endif /* _WINDOWS */ +static void zbx_on_exit(int ret) +{ + zabbix_log(LOG_LEVEL_DEBUG, "zbx_on_exit() called with ret:%d", ret); + + zbx_free_service_resources(ret); + +#if defined(_WINDOWS) && (defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)) + zbx_tls_free(); + zbx_tls_library_deinit(); /* deinitialize crypto library from parent thread */ +#endif +#if defined(PS_OVERWRITE_ARGV) + setproctitle_free_env(); +#endif +#ifdef _WINDOWS + while (0 == WSACleanup()) + ; +#endif + exit(EXIT_SUCCESS); +} + int MAIN_ZABBIX_ENTRY(int flags) { zbx_socket_t listen_sock; @@ -1301,27 +1321,6 @@ void zbx_free_service_resources(int ret) #endif } -void zbx_on_exit(int ret) -{ - zabbix_log(LOG_LEVEL_DEBUG, "zbx_on_exit() called with ret:%d", ret); - - zbx_free_service_resources(ret); - -#if defined(_WINDOWS) && (defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)) - zbx_tls_free(); - zbx_tls_library_deinit(); /* deinitialize crypto library from parent thread */ -#endif -#if defined(PS_OVERWRITE_ARGV) - setproctitle_free_env(); -#endif -#ifdef _WINDOWS - while (0 == WSACleanup()) - ; -#endif - - exit(EXIT_SUCCESS); -} - int main(int argc, char **argv) { ZBX_TASK_EX t = {ZBX_TASK_START}; |