glib: update to glib-2.27.3

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-11-15 12:19:42 +01:00
parent b6babca52c
commit 6ae0dd6332
2 changed files with 1 additions and 105 deletions

View File

@ -1,5 +1,5 @@
PKG_NAME="glib"
PKG_VERSION="2.27.2"
PKG_VERSION="2.27.3"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="LGPL"

View File

@ -1,104 +0,0 @@
--- 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);
}