# HG changeset patch
# User Bernd Schubert <bernd.schub...@fastmail.fm>
# Date 1289416214 -3600
# Node ID 2eab79309d86cbf93f6d2c057095f2229040a140
# Parent  4358a55b3c5df36d05d94e160378aafa9809b5d4
cl_log: Simplify a function

Signed-off-by: Bernd Schubert <bschub...@ddn.com>

diff --git a/lib/clplumbing/cl_log.c b/lib/clplumbing/cl_log.c
--- a/lib/clplumbing/cl_log.c
+++ b/lib/clplumbing/cl_log.c
@@ -534,7 +534,7 @@ cl_direct_log(int priority, const char* 
                entity =cl_log_entity;
        }
        
-       pristr = use_priority_str ? prio2str(priority) : NULL;
+       pristr = use_priority_str ? prio2str(priority) : "";
 
        if (needprivs) {
                return_to_orig_privs();
@@ -544,17 +544,13 @@ cl_direct_log(int priority, const char* 
                if (entity) {
                        strncpy(common_log_entity, entity, MAXENTITY);
                } else {
-                       strncpy(common_log_entity, DFLT_ENTITY,MAXENTITY);
+                       strncpy(common_log_entity, DFLT_ENTITY, MAXENTITY);
                }
 
                common_log_entity[MAXENTITY-1] = '\0';
 
-               if (pristr) {
-                       syslog(priority, "[%d]: %s: %s%c",
-                              entity_pid, pristr,  buf, 0);
-               }else {
-                       syslog(priority, "[%d]: %s%c", entity_pid, buf, 0);
-               }
+               syslog(priority, "[%d]: %s: %s%c",
+                      entity_pid, pristr,  buf, 0);
        }
 
        if (debugfile_name != NULL) {
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to