[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 17/41] cman: make 2 var const and allow backup defaults



Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>
---
:100644 100644 9d52fde... 522994b... M	cman/daemon/cman-preconfig.c
 cman/daemon/cman-preconfig.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 9d52fde..522994b 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -805,8 +805,8 @@ out:
 static void add_logging_overrides(struct objdb_iface_ver0 *objdb)
 {
 	char *logstr;
-	char *logfacility;
-	char *loglevel;
+	const char *logfacility;
+	const char *loglevel;
 	hdb_handle_t object_handle;
 	hdb_handle_t find_handle;
 
@@ -820,7 +820,11 @@ static void add_logging_overrides(struct objdb_iface_ver0 *objdb)
 	objdb->object_find_destroy(find_handle);
 
 	logfacility = facility_name_get(SYSLOGFACILITY);
+	if (!logfacility)
+		logfacility = "LOG_LOCAL4";
 	loglevel = priority_name_get(SYSLOGLEVEL);
+	if (!loglevel)
+		loglevel = "LOG_INFO";
 
 	/* enable timestamps on logging */
 	if (objdb_get_string(objdb, object_handle, "timestamp", &logstr)) {
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]