[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: core: log error reason when failing to open the status file (Andreas Ericsson) #1078

git at icinga.org git at icinga.org
Wed Jan 5 10:59:58 CET 2011


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Jan  4 17:20:54 2011 +0100

core: log error reason when failing to open the status file (Andreas Ericsson) #1078

fixes #1078

---

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

diff --git a/Changelog b/Changelog
index 8f0a4d1..41315a9 100644
--- a/Changelog
+++ b/Changelog
@@ -42,6 +42,7 @@ FIXES
 * core: children should no longer hang on mutex locks held in parent for localtime() (and similar) calls (Andreas Ericsson) #1039
 * core: debug logging is now properly serialized, using soft-locking with a timeout of 150 milliseconds to avoid multiple threads competing for the privilege to write debug info (Andreas Ericsson) #1035
 * core: fix parsing of long plugin output for async host checks (Jochen Bern) #1046
+* core: log error reason when failing to open the status file (Andreas Ericsson) #1078
 
 * classic ui: change servicestatus letter color to default black, not grey #946
 * classic ui: fix waste of cpu in status summary (TomTom) #933
diff --git a/xdata/xsddefault.c b/xdata/xsddefault.c
index d7423fd..0a57d5f 100644
--- a/xdata/xsddefault.c
+++ b/xdata/xsddefault.c
@@ -365,7 +365,7 @@ int xsddefault_save_status_data(void){
 	if((fd=mkstemp(temp_file))==-1){
 
 		/* log an error */
-		logit(NSLOG_RUNTIME_ERROR,TRUE,"Error: Unable to create temp file for writing status data!\n");
+		logit(NSLOG_RUNTIME_ERROR,TRUE,"Error: Unable to create temp file for writing status data: %s\n", strerror(errno));
 
 		/* free memory */
 		my_free(temp_file);
@@ -379,7 +379,7 @@ int xsddefault_save_status_data(void){
 		unlink(temp_file);
 
 		/* log an error */
-		logit(NSLOG_RUNTIME_ERROR,TRUE,"Error: Unable to open temp file '%s' for writing status data!\n",temp_file);
+		logit(NSLOG_RUNTIME_ERROR,TRUE,"Error: Unable to open temp file '%s' for writing status data: %s\n",temp_file, strerror(errno));
 
 		/* free memory */
 		my_free(temp_file);





More information about the icinga-checkins mailing list