summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/dbus-monitor.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index 873108bc..f2f73142 100644
--- a/tools/dbus-monitor.c
+++ b/tools/dbus-monitor.c
@@ -33,8 +33,6 @@
#include <time.h>
-#include <signal.h>
-
#include "dbus-print-message.h"
#ifdef DBUS_WIN
@@ -66,12 +64,12 @@ monitor_filter_func (DBusConnection *connection,
void *user_data)
{
print_message (message, FALSE);
-
+
if (dbus_message_is_signal (message,
DBUS_INTERFACE_LOCAL,
"Disconnected"))
exit (0);
-
+
/* Conceptually we want this to be
* DBUS_HANDLER_RESULT_NOT_YET_HANDLED, but this raises
* some problems. See bug 1719.
@@ -195,14 +193,6 @@ usage (char *name, int ecode)
exit (ecode);
}
-static dbus_bool_t sigint_received = FALSE;
-
-static void
-sigint_handler (int signum)
-{
- sigint_received = TRUE;
-}
-
int
main (int argc, char *argv[])
{
@@ -211,9 +201,12 @@ main (int argc, char *argv[])
DBusBusType type = DBUS_BUS_SESSION;
DBusHandleMessageFunction filter_func = monitor_filter_func;
char *address = NULL;
-
+
int i = 0, j = 0, numFilters = 0;
char **filters = NULL;
+
+ setvbuf(stdout, NULL, _IOLBF, 0);
+
for (i = 1; i < argc; i++)
{
char *arg = argv[i];
@@ -340,13 +333,10 @@ main (int argc, char *argv[])
}
/* we handle SIGINT so exit() is reached and flushes stdout */
- signal (SIGINT, sigint_handler);
- while (dbus_connection_read_write_dispatch(connection, -1)
- && !sigint_received)
+ while (dbus_connection_read_write_dispatch(connection, -1))
;
exit (0);
lose:
fprintf (stderr, "Error: %s\n", error.message);
exit (1);
}
-