X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=common%2Fcommon.c;h=1b8cd980b681040703db3717f756e676870d1b5b;hb=d622febc1fb702194f7ac3f95bfa6cba448dcc5b;hp=63f0d9ab4663e6102b0fcc5564fa8d2baa305bfa;hpb=84bb99c3a5a18d3471607db1c8af880b40158572;p=apps%2Fpfixtools.git diff --git a/common/common.c b/common/common.c index 63f0d9a..1b8cd98 100644 --- a/common/common.c +++ b/common/common.c @@ -41,9 +41,10 @@ #include "common.h" -bool daemon_process = true; -int log_level = LOG_INFO; -bool log_syslog = false; +bool daemon_process = true; +int log_level = LOG_INFO; +bool log_syslog = false; +const char *log_state = ""; static FILE *pidfile = NULL; @@ -293,8 +294,9 @@ void common_register_exit(exitcall_t exitcall) static void common_shutdown(void) { + log_state = "stopping "; if (daemon_process && log_syslog) { - info("stopping..."); + info(""); } pidfile_close(); for (int i = array_len(__exit) - 1 ; i >= 0 ; --i) { @@ -309,6 +311,7 @@ void common_init(void) if (__ran) { return; } + log_state = "starting "; if (atexit(common_shutdown)) { fputs("Cannot hook my atexit function, quitting !\n", stderr); abort();