[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: icinga.c: replace asprintf() + write_to_logs_and_console() with logit() (Andreas Ericsson)

git at icinga.org git at icinga.org
Wed May 12 18:57:42 CEST 2010


Module: icinga-core
Branch: mfriedrich/core
Commit: 2cd1c8fd9552a47d92c40416695a52171b1315f3
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2cd1c8fd9552a47d92c40416695a52171b1315f3

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed May 12 16:46:19 2010 +0200

icinga.c: replace asprintf() + write_to_logs_and_console() with logit() (Andreas Ericsson)

[--snip--]
It was invented for that precis reason.
[--snip--]

true :)

fixes #392

---

 Changelog     |    1 +
 base/icinga.c |    4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 21dff71..f9c41d4 100644
--- a/Changelog
+++ b/Changelog
@@ -23,6 +23,7 @@ FIXES
 * core: introduce common/shared.c and include/shared.h (Andreas Ericsson)
 * core: move cgiutils.h compile time option macros to config.h (Andreas Ericsson)
 * core: icinga.c: remove conditional main() configuration (Andreas Ericsson)
+* core: icinga.c: replace asprintf() + write_to_logs_and_console() with logit() (Andreas Ericsson)
 
 * idoutils: Host DB inserts use string 'NULL\n' instead of NULL (William Preston)
 * idoutils: ndo2db_get_object_id fails to return existing IDs (William Preston)
diff --git a/base/icinga.c b/base/icinga.c
index 1fc30ac..c444d0e 100644
--- a/base/icinga.c
+++ b/base/icinga.c
@@ -671,9 +671,7 @@ int main(int argc, char **argv, char **env){
 			now=time(NULL);
 			tm=localtime(&now);
 			strftime(datestring,sizeof(datestring),"%a %b %d %H:%M:%S %Z %Y",tm);
-			asprintf(&buffer,"Local time is %s\n",datestring);
-			write_to_logs_and_console(buffer,NSLOG_PROCESS_INFO,TRUE);
-			my_free(buffer);
+			logit(NSLOG_PROCESS_INFO,TRUE,"Local time is %s",datestring);
 
 			/* write log version/info */
 			write_log_file_info(NULL);





More information about the icinga-checkins mailing list