diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | tools/dbus-monitor.c | 28 |
2 files changed, 32 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2004-05-25 Colin Walters <walters@redhat.com> + + * tools/dbus-monitor.c (main): Monitor all types of messages. + 2004-05-23 Owen Fraser-Green <owen@discobabe.net> * mono/Handler.cs, mono/Service.cs: Added UnregisterObject method @@ -146,6 +150,7 @@ * mono/DBusType/Array.cs: Handle empty arrays * mono/Arguments.cs: Handle empty arguments +>>>>>>> 1.496 2004-04-30 Owen Fraser-Green <owen@discobabe.net> * dbus-sharp.pc.in: Modified to include include Libs and Requires diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index 23ee346a..91668546 100644 --- a/tools/dbus-monitor.c +++ b/tools/dbus-monitor.c @@ -94,9 +94,35 @@ main (int argc, char *argv[]) dbus_connection_setup_with_g_main (connection, NULL); - dbus_connection_add_filter (connection, filter_func, NULL, NULL); + dbus_bus_add_match (connection, + "type='signal'", + &error); + if (dbus_error_is_set (&error)) + goto lose; + dbus_bus_add_match (connection, + "type='method_call'", + &error); + if (dbus_error_is_set (&error)) + goto lose; + dbus_bus_add_match (connection, + "type='method_return'", + &error); + if (dbus_error_is_set (&error)) + goto lose; + dbus_bus_add_match (connection, + "type='error'", + &error); + if (dbus_error_is_set (&error)) + goto lose; + if (!dbus_connection_add_filter (connection, filter_func, NULL, NULL)) { + fprintf (stderr, "Couldn't add filter!\n"); + exit (1); + } g_main_loop_run (loop); exit (0); + lose: + fprintf (stderr, "Error: %s\n", error.message); + exit (1); } |