dbus/tools Makefile.am,1.17,1.18 dbus-monitor.c,1.15,1.16

Ross Burton ross at kemper.freedesktop.org
Wed Jun 14 07:39:53 PDT 2006


Update of /cvs/dbus/dbus/tools
In directory kemper:/tmp/cvs-serv28038/tools

Modified Files:
	Makefile.am dbus-monitor.c 
Log Message:
2006-06-14  Ross Burton  <ross at openedhand.com>

	* tools/Makefile.am:
	* tools/dbus-monitor.c:
	Don't use the GLib bindings in dbus-monitor (patch from Ralf
	Habacker).


Index: Makefile.am
===================================================================
RCS file: /cvs/dbus/dbus/tools/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Makefile.am	6 Sep 2005 22:38:54 -0000	1.17
+++ Makefile.am	14 Jun 2006 14:39:51 -0000	1.18
@@ -1,7 +1,6 @@
 INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION
 
 if HAVE_GLIB
-GLIB_TOOLS=dbus-monitor
 
 nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h
 libdbus_glibdir = $(includedir)/dbus-1.0/dbus
@@ -11,8 +10,6 @@
 
 BUILT_SOURCES = dbus-glib-bindings.h dbus-bus-introspect.xml
 
-else
-GLIB_TOOLS=
 endif
 
 if HAVE_GTK
@@ -26,7 +23,7 @@
 	DBUS_TOP_BUILDDIR=$(top_builddir) $(srcdir)/run-with-tmp-session-bus.sh ./dbus-send --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
 endif
 
-bin_PROGRAMS=dbus-send $(GLIB_TOOLS) dbus-launch dbus-cleanup-sockets $(GTK_TOOLS)
+bin_PROGRAMS=dbus-send dbus-monitor dbus-launch dbus-cleanup-sockets $(GTK_TOOLS)
 
 dbus_send_SOURCES=				\
 	dbus-print-message.c			\
@@ -52,7 +49,7 @@
 	dbus-viewer.c
 
 dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
-dbus_monitor_LDADD= $(top_builddir)/glib/libdbus-glib-1.la
+dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la
 dbus_launch_LDADD= $(DBUS_X_LIBS)
 dbus_viewer_LDADD= $(top_builddir)/glib/libdbus-gtool.la $(DBUS_GTK_THREADS_LIBS) $(DBUS_GLIB_TOOL_LIBS)
 

Index: dbus-monitor.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-monitor.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- dbus-monitor.c	29 Oct 2005 17:02:58 -0000	1.15
+++ dbus-monitor.c	14 Jun 2006 14:39:51 -0000	1.16
@@ -23,8 +23,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
 #include "dbus-print-message.h"
 
 static DBusHandlerResult
@@ -59,7 +57,7 @@
   DBusConnection *connection;
   DBusError error;
   DBusBusType type = DBUS_BUS_SESSION;
-  GMainLoop *loop;
+
   int i = 0, j = 0, numFilters = 0;
   char **filters = NULL;
   for (i = 1; i < argc; i++)
@@ -85,8 +83,6 @@
       }
     }
 
-  loop = g_main_loop_new (NULL, FALSE);
-
   dbus_error_init (&error);
   connection = dbus_bus_get (type, &error);
   if (connection == NULL)
@@ -98,8 +94,6 @@
       exit (1);
     }
 
-  dbus_connection_setup_with_g_main (connection, NULL);
-
   if (numFilters)
     {
       for (i = 0; i < j; i++)
@@ -143,9 +137,8 @@
     fprintf (stderr, "Couldn't add filter!\n");
     exit (1);
   }
-
-  g_main_loop_run (loop);
-
+  while (dbus_connection_read_write_dispatch(connection, -1))
+    ;
   exit (0);
  lose:
   fprintf (stderr, "Error: %s\n", error.message);



More information about the dbus-commit mailing list