diff options
author | Havoc Pennington <hp@redhat.com> | 2003-08-18 22:43:30 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-08-18 22:43:30 +0000 |
commit | 68a3c593b9e77b33614726363c7b6fd85d113021 (patch) | |
tree | ec3035e33c20febc29d2b27e13139540dc739bbc /tools/dbus-send.c | |
parent | 95717a938b237d12211935f6a7467ef610288fe5 (diff) |
2003-08-18 Havoc Pennington <hp@redhat.com>
* dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix
* dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
dumb bug created earlier (wrong order of args to
decode_header_data())
* tools/dbus-send.c: port
* tools/dbus-print-message.c (print_message): port
* test/data/*messages: port all messages over
* dbus/dbus-message-builder.c: support including
message type
* bus/driver.c: port over
* bus/dispatch.c: port over to new stuff
* dbus/dbus-connection.c (_dbus_connection_new_for_transport):
rename disconnect signal to "Disconnected"
Diffstat (limited to 'tools/dbus-send.c')
-rw-r--r-- | tools/dbus-send.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/dbus-send.c b/tools/dbus-send.c index fb876b52..7ea49aac 100644 --- a/tools/dbus-send.c +++ b/tools/dbus-send.c @@ -44,7 +44,7 @@ main (int argc, char *argv[]) DBusMessageIter iter; int i; DBusBusType type = DBUS_BUS_SESSION; - const char *dest = DBUS_SERVICE_BROADCAST; + const char *dest = DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST; char *name = NULL; int message_type = DBUS_MESSAGE_TYPE_SIGNAL; const char *type_str = NULL; @@ -106,11 +106,35 @@ main (int argc, char *argv[]) if (message_type == DBUS_MESSAGE_TYPE_METHOD_CALL) { - message = dbus_message_new_method_call (name, NULL); + char *last_dot; + + last_dot = strrchr (name, '.'); + if (last_dot == NULL) + { + fprintf (stderr, "Must use org.mydomain.Interface.Method notation, no dot in \"%s\"\n", + name); + exit (1); + } + *last_dot = '\0'; + + message = dbus_message_new_method_call (name, + last_dot + 1, + NULL); } else if (message_type == DBUS_MESSAGE_TYPE_SIGNAL) { - message = dbus_message_new_signal (name); + char *last_dot; + + last_dot = strrchr (name, '.'); + if (last_dot == NULL) + { + fprintf (stderr, "Must use org.mydomain.Interface.Signal notation, no dot in \"%s\"\n", + name); + exit (1); + } + *last_dot = '\0'; + + message = dbus_message_new_signal (name, last_dot + 1); } else { |