mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 04:58:02 +02:00
dbus-monitor: use common code from dbus-test-tool
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall [also sync up the cmake build system -smcv]
This commit is contained in:
parent
ca63ef7133
commit
9806240b78
3 changed files with 12 additions and 13 deletions
|
|
@ -8,6 +8,8 @@ set (dbus_monitor_SOURCES
|
|||
../../tools/dbus-monitor.c
|
||||
../../tools/dbus-print-message.c
|
||||
../../tools/dbus-print-message.h
|
||||
../../tools/tool-common.c
|
||||
../../tools/tool-common.h
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
|
|
|
|||
|
|
@ -31,10 +31,13 @@ dbus_send_SOURCES= \
|
|||
dbus-print-message.h \
|
||||
dbus-send.c
|
||||
|
||||
dbus_monitor_SOURCES= \
|
||||
dbus-monitor.c \
|
||||
dbus-print-message.c \
|
||||
dbus-print-message.h
|
||||
dbus_monitor_SOURCES = \
|
||||
dbus-monitor.c \
|
||||
dbus-print-message.c \
|
||||
dbus-print-message.h \
|
||||
tool-common.c \
|
||||
tool-common.h \
|
||||
$(NULL)
|
||||
|
||||
if DBUS_WIN
|
||||
dbus_launch_SOURCES= \
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <time.h>
|
||||
|
||||
#include "dbus-print-message.h"
|
||||
#include "tool-common.h"
|
||||
|
||||
#define EAVESDROPPING_RULE "eavesdrop=true"
|
||||
|
||||
|
|
@ -78,13 +79,6 @@ gettimeofday (struct timeval *__p,
|
|||
}
|
||||
#endif
|
||||
|
||||
inline static void
|
||||
oom (const char *doing)
|
||||
{
|
||||
fprintf (stderr, "OOM while %s\n", doing);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static DBusHandlerResult
|
||||
monitor_filter_func (DBusConnection *connection,
|
||||
DBusMessage *message,
|
||||
|
|
@ -312,10 +306,10 @@ main (int argc, char *argv[])
|
|||
|
||||
filters = (char **) realloc (filters, numFilters * sizeof (char *));
|
||||
if (filters == NULL)
|
||||
oom ("adding a new filter slot");
|
||||
tool_oom ("adding a new filter slot");
|
||||
filters[j] = (char *) malloc (filter_len);
|
||||
if (filters[j] == NULL)
|
||||
oom ("adding a new filter");
|
||||
tool_oom ("adding a new filter");
|
||||
snprintf (filters[j], filter_len, "%s,%s", EAVESDROPPING_RULE, arg);
|
||||
j++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue