[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: idoutils: add error string to config availability checks

git at icinga.org git at icinga.org
Fri Jan 7 13:41:39 CET 2011


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri Jan  7 13:40:53 2011 +0100

idoutils: add error string to config availability checks

---

 module/idoutils/src/ido2db.c |    2 +-
 module/idoutils/src/idomod.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index 0b624a9..9ab72e2 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -398,7 +398,7 @@ int ido2db_process_config_file(char *filename){
 
 	/* open the file */
 	if((thefile=ido_mmap_fopen(filename))==NULL){
-		syslog(LOG_ERR, "Error: Unable to open configuration file, please check permissions on %s\n", filename);
+		syslog(LOG_ERR, "Error: Unable to open configuration file %s: %s\n", filename, strerror(errno));
 		return IDO_ERROR;
 	}
 
diff --git a/module/idoutils/src/idomod.c b/module/idoutils/src/idomod.c
index 7568d54..ff4ee26 100644
--- a/module/idoutils/src/idomod.c
+++ b/module/idoutils/src/idomod.c
@@ -334,7 +334,7 @@ int idomod_process_config_file(char *filename){
 
 	/* open the file */
 	if((thefile=ido_mmap_fopen(filename))==NULL){
-		snprintf(temp_buffer,sizeof(temp_buffer)-1,"idomod: Unable to open configuration file, please check permissions on %s\n", filename);
+		snprintf(temp_buffer,sizeof(temp_buffer)-1,"idomod: Unable to open configuration file %s: %s\n", filename, strerror(errno));
 		temp_buffer[sizeof(temp_buffer)-1]='\x0';
 		idomod_write_to_logs(temp_buffer,NSLOG_INFO_MESSAGE);
 		return IDO_ERROR;





More information about the icinga-checkins mailing list