rpms/telepathy-gabble/OLPC-3 use-tp_debug_divert_messages.patch, NONE, 1.1

Guillaume Desmottes (gdesmott) fedora-extras-commits at redhat.com
Fri Aug 15 10:09:40 UTC 2008


Author: gdesmott

Update of /cvs/pkgs/rpms/telepathy-gabble/OLPC-3
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31310

Added Files:
	use-tp_debug_divert_messages.patch 
Log Message:
add use-tp_debug_divert_messages.patch


use-tp_debug_divert_messages.patch:

--- NEW FILE use-tp_debug_divert_messages.patch ---
diff -rN -u old-telepathy-gabble/src/debug.c new-telepathy-gabble/src/debug.c
--- old-telepathy-gabble/src/debug.c	2008-08-15 10:52:20.168023347 +0100
+++ new-telepathy-gabble/src/debug.c	2008-08-15 10:52:20.216026347 +0100
@@ -12,39 +12,6 @@
 #include <glib/gstdio.h>
 #include <telepathy-glib/debug.h>
 
-void
-gabble_debug_set_log_file_from_env (void)
-{
-  const gchar *output_file;
-  int out;
-
-  output_file = g_getenv ("GABBLE_LOGFILE");
-  if (output_file == NULL)
-    return;
-
-  out = g_open (output_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
-  if (out == -1)
-    {
-      g_warning ("Can't open logfile '%s': %s", output_file,
-          g_strerror (errno));
-      return;
-    }
-
-  if (dup2 (out, STDOUT_FILENO) == -1)
-    {
-      g_warning ("Error when duplicating stdout file descriptor: %s",
-          g_strerror (errno));
-      return;
-    }
-
-  if (dup2 (out, STDERR_FILENO) == -1)
-    {
-      g_warning ("Error when duplicating stderr file descriptor: %s",
-          g_strerror (errno));
-      return;
-    }
-}
-
 #ifdef ENABLE_DEBUG
 
 static GabbleDebugFlags flags = 0;
diff -rN -u old-telepathy-gabble/src/debug.h new-telepathy-gabble/src/debug.h
--- old-telepathy-gabble/src/debug.h	2008-08-15 10:52:20.168023347 +0100
+++ new-telepathy-gabble/src/debug.h	2008-08-15 10:52:20.248028347 +0100
@@ -6,12 +6,6 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
-
-void gabble_debug_set_log_file_from_env (void);
-
-G_END_DECLS
-
 #ifdef ENABLE_DEBUG
 
 G_BEGIN_DECLS
diff -rN -u old-telepathy-gabble/src/gabble.c new-telepathy-gabble/src/gabble.c
--- old-telepathy-gabble/src/gabble.c	2008-08-15 10:52:20.168023347 +0100
+++ new-telepathy-gabble/src/gabble.c	2008-08-15 10:52:20.216026347 +0100
@@ -61,7 +61,7 @@
 gabble_main (int argc,
              char **argv)
 {
-  gabble_debug_set_log_file_from_env ();
+  tp_debug_divert_messages (g_getenv ("GABBLE_LOGFILE"));
 
 #ifdef ENABLE_DEBUG
   gabble_debug_set_flags_from_env ();






More information about the fedora-extras-commits mailing list