diff options
author | Colin Walters <walters@verbum.org> | 2004-05-25 18:02:17 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2004-05-25 18:02:17 +0000 |
commit | aa54f14c05569189838e430a45c7ccac5ab20d10 (patch) | |
tree | c793b51bb1823dd66e23f395b9bb4ca90eb9a409 /tools | |
parent | e55e38d8dfc4255282b59a8fa1830f7b0b458685 (diff) | |
download | dbus-aa54f14c05569189838e430a45c7ccac5ab20d10.tar.gz |
monitor all types of messages
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dbus-monitor.c | 28 |
1 files changed, 27 insertions, 1 deletions
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); } |