- add some patches from moblin
This commit is contained in:
Stephan Raue 2010-02-07 21:05:45 +01:00
parent 41617f0c54
commit c7473fe4a0
2 changed files with 119 additions and 0 deletions

View File

@ -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; }

View File

@ -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 <signal.h>
#include <locale.h>
#include <errno.h>
+#include <syslog.h>
#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);
}