Blame SOURCES/pacemaker-fix_logging_glib_crit_messages_should_not_produce_core_files_by_default.patch

ed0026
commit 2fc7c2091ffd82a585352e34964af77ef67aa51a
ed0026
Author: Andrew Beekhof <andrew@beekhof.net>
ed0026
Date:   Tue Aug 6 13:16:07 2013 +1000
ed0026
ed0026
    Fix: logging: glib CRIT messages should not produce core files by default
ed0026
ed0026
diff --git a/lib/common/logging.c b/lib/common/logging.c
ed0026
index b4ca277..2b74d3f 100644
ed0026
--- a/lib/common/logging.c
ed0026
+++ b/lib/common/logging.c
ed0026
@@ -56,12 +56,21 @@ crm_glib_handler(const gchar * log_domain, GLogLevelFlags flags, const gchar * m
ed0026
 {
ed0026
     int log_level = LOG_WARNING;
ed0026
     GLogLevelFlags msg_level = (flags & G_LOG_LEVEL_MASK);
ed0026
+    static struct qb_log_callsite *glib_cs = NULL;
ed0026
+
ed0026
+    if (glib_cs == NULL) {
ed0026
+        glib_cs = qb_log_callsite_get(__PRETTY_FUNCTION__, __FILE__, "glib-handler", LOG_DEBUG, __LINE__, crm_trace_nonlog);
ed0026
+    }
ed0026
+
ed0026
 
ed0026
     switch (msg_level) {
ed0026
         case G_LOG_LEVEL_CRITICAL:
ed0026
-            /* log and record how we got here */
ed0026
-            crm_abort(__FILE__, __PRETTY_FUNCTION__, __LINE__, message, TRUE, TRUE);
ed0026
-            return;
ed0026
+            log_level = LOG_CRIT;
ed0026
+
ed0026
+            if (crm_is_callsite_active(glib_cs, LOG_DEBUG, 0) == FALSE) {
ed0026
+                /* log and record how we got here */
ed0026
+                crm_abort(__FILE__, __PRETTY_FUNCTION__, __LINE__, message, TRUE, TRUE);
ed0026
+            }
ed0026
 
ed0026
         case G_LOG_LEVEL_ERROR:
ed0026
             log_level = LOG_ERR;