[asterisk-commits] branch 1.2 r9232 - in /branches/1.2: channels/chan_oss.c logger.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 8 15:12:36 MST 2006


Author: mogorman
Date: Wed Feb  8 16:12:34 2006
New Revision: 9232

URL: http://svn.digium.com/view/asterisk?rev=9232&view=rev
Log:
Make logger report error,warning,notice if logger.conf
not found, also updated chan_oss to give correct
error message if its config file is not found.

Modified:
    branches/1.2/channels/chan_oss.c
    branches/1.2/logger.c

Modified: branches/1.2/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_oss.c?rev=9232&r1=9231&r2=9232&view=diff
==============================================================================
--- branches/1.2/channels/chan_oss.c (original)
+++ branches/1.2/channels/chan_oss.c Wed Feb  8 16:12:34 2006
@@ -1376,6 +1376,9 @@
 			store_config(cfg, ctg);
 		} while ( (ctg = ast_category_browse(cfg, ctg)) != NULL);
 		ast_config_destroy(cfg);
+	} else {
+		 ast_log(LOG_NOTICE, "Unable to load config oss.conf\n");
+		 return -1;
 	}
 	if (find_desc(oss_active) == NULL) {
 		ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);

Modified: branches/1.2/logger.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/logger.c?rev=9232&r1=9231&r2=9232&view=diff
==============================================================================
--- branches/1.2/logger.c (original)
+++ branches/1.2/logger.c Wed Feb  8 16:12:34 2006
@@ -309,9 +309,18 @@
 	
 	cfg = ast_config_load("logger.conf");
 	
-	/* If no config file, we're fine */
-	if (!cfg)
+	/* If no config file, we're fine, set default options. */
+	if (!cfg) {
+		fprintf(stderr, "Unable to open logger.conf: %s\n", strerror(errno));
+		chan = malloc(sizeof(struct logchannel));
+		memset(chan, 0, sizeof(struct logchannel));
+		chan->type = LOGTYPE_CONSOLE;
+		chan->logmask = 28; /*warning,notice,error */
+		chan->next = logchannels;
+		logchannels = chan;
+		global_logmask |= chan->logmask;
 		return;
+	}
 	
 	ast_mutex_lock(&loglock);
 	if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) {



More information about the asterisk-commits mailing list