From c7473fe4a00c7db5bb230ed07bca7290fd46f788 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 7 Feb 2010 21:05:45 +0100 Subject: [PATCH] glib: - add some patches from moblin --- .../devel/glib/patches/glib-i386-atomic.diff | 15 +++ .../patches/glib-syslog-message-handler.diff | 104 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 packages/devel/glib/patches/glib-i386-atomic.diff create mode 100644 packages/devel/glib/patches/glib-syslog-message-handler.diff diff --git a/packages/devel/glib/patches/glib-i386-atomic.diff b/packages/devel/glib/patches/glib-i386-atomic.diff new file mode 100644 index 0000000000..01495c0070 --- /dev/null +++ b/packages/devel/glib/patches/glib-i386-atomic.diff @@ -0,0 +1,15 @@ +diff -up glib-2.16.6/configure.atomic glib-2.16.6/configure +--- glib-2.16.6/configure.atomic 2008-10-27 18:24:20.000000000 -0400 ++++ glib-2.16.6/configure 2008-10-27 18:24:31.000000000 -0400 +@@ -42742,11 +42742,6 @@ $as_echo_n "checking whether to use asse + + if test x"$GCC" = xyes; then + case $host_cpu in +- i386) +- { $as_echo "$as_me:$LINENO: result: none" >&5 +-$as_echo "none" >&6; } +- glib_memory_barrier_needed=no +- ;; + i?86) + { $as_echo "$as_me:$LINENO: result: i486" >&5 + $as_echo "i486" >&6; } diff --git a/packages/devel/glib/patches/glib-syslog-message-handler.diff b/packages/devel/glib/patches/glib-syslog-message-handler.diff new file mode 100644 index 0000000000..febe8bf790 --- /dev/null +++ b/packages/devel/glib/patches/glib-syslog-message-handler.diff @@ -0,0 +1,104 @@ +--- glib-2.19.6/glib/gmessages.c.orig 2009-02-02 19:17:45.000000000 +0000 ++++ glib-2.19.6/glib/gmessages.c 2009-02-17 16:33:22.000000000 +0000 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #include "glib.h" + #include "gdebug.h" +@@ -873,6 +874,83 @@ + } + } + ++/* That is a syslog version of default log handler. */ ++ ++#define IS_EMPTY_STRING(s) (NULL == (s) || 0 == *(s)) ++ ++#define GLIB_PREFIX "GLIB" ++#define DEFAULT_DOMAIN "default" ++#define DEFAULT_MESSAGE "(NULL) message" ++ ++static void ++g_log_syslog_handler (const gchar *log_domain, ++ GLogLevelFlags log_level, ++ const gchar *message, ++ gpointer unused_data) ++{ ++ /* This value will be switched to TRUE when log facility is initialized */ ++ static gboolean initialized = FALSE; ++ ++ /* This call only variables */ ++ const gchar* alert = (log_level & ALERT_LEVELS ? " ** " : " "); ++ const gchar* aborting = (log_level & G_LOG_FLAG_FATAL ? "\naborting..." : ""); ++ ++ const gchar* prefix; ++ int priority; ++ ++ /* Check first that logging facility is initialized */ ++ if (!initialized) ++ { ++ openlog (NULL, LOG_PID, LOG_USER); ++ initialized = !initialized; ++ } ++ ++ /* Validate log domain */ ++ if (IS_EMPTY_STRING(log_domain)) ++ log_domain = DEFAULT_DOMAIN; ++ ++ /* Check log message for validity */ ++ if (IS_EMPTY_STRING(message)) ++ message = DEFAULT_MESSAGE; ++ ++ /* Process the message prefix and priority */ ++ switch (log_level & G_LOG_LEVEL_MASK) ++ { ++ case G_LOG_FLAG_FATAL: ++ prefix = "FATAL"; ++ priority = LOG_EMERG; ++ break; ++ case G_LOG_LEVEL_ERROR: ++ prefix = "ERROR"; ++ priority = LOG_ERR; ++ break; ++ case G_LOG_LEVEL_CRITICAL: ++ prefix = "CRITICAL"; ++ priority = LOG_CRIT; ++ break; ++ case G_LOG_LEVEL_WARNING: ++ prefix = "WARNING"; ++ priority = LOG_WARNING; ++ break; ++ case G_LOG_LEVEL_MESSAGE: ++ prefix = "MESSAGE"; ++ priority = LOG_NOTICE; ++ break; ++ case G_LOG_LEVEL_INFO: ++ prefix = "INFO"; ++ priority = LOG_INFO; ++ break; ++ default: ++ prefix = "DEBUG"; ++ priority = LOG_DEBUG; ++ break; ++ } ++ ++ /* Now printing the message to syslog */ ++ syslog (priority, "%s %s%s%s - %s%s", GLIB_PREFIX, prefix, alert, log_domain, ++ message, aborting); ++} ++ + void + g_log_default_handler (const gchar *log_domain, + GLogLevelFlags log_level, +@@ -948,6 +1026,9 @@ + string = g_string_free (gstring, FALSE); + + write_string (fd, string); ++ ++ /* */ ++ g_log_syslog_handler(log_domain, log_level, message, unused_data); + g_free (string); + } +