mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 21:26:49 +00:00
glib:
- add some patches from moblin
This commit is contained in:
parent
41617f0c54
commit
c7473fe4a0
15
packages/devel/glib/patches/glib-i386-atomic.diff
Normal file
15
packages/devel/glib/patches/glib-i386-atomic.diff
Normal 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; }
|
104
packages/devel/glib/patches/glib-syslog-message-handler.diff
Normal file
104
packages/devel/glib/patches/glib-syslog-message-handler.diff
Normal 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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user