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 @@ -545,7 +545,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(); @@ -555,17 +555,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) { _______________________________________________ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker