summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-03-27 05:29:31 +0000
committerHavoc Pennington <hp@redhat.com>2004-03-27 05:29:31 +0000
commita221eefadfb48488129dedca2f2dc062e1c718e7 (patch)
tree37300627bdf5c2a5bda63ee86b9c00f64cd294da /tools
parent45277e93d8c8e18a04d1c28eb666337316726152 (diff)
2004-03-27 Havoc Pennington <hp@redhat.com>
Patch from Timo Teräs: * tools/dbus-send.c (main): if --print-reply, assume type is method call; support boolean type args * dbus/dbus-connection.c (dbus_connection_send_with_reply): fix a bunch of memleak and logic bugs
Diffstat (limited to 'tools')
-rw-r--r--tools/dbus-send.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/dbus-send.c b/tools/dbus-send.c
index d0cca2fd..5ff9f576 100644
--- a/tools/dbus-send.c
+++ b/tools/dbus-send.c
@@ -64,7 +64,10 @@ main (int argc, char *argv[])
else if (strcmp (arg, "--session") == 0)
type = DBUS_BUS_SESSION;
else if (strcmp (arg, "--print-reply") == 0)
- print_reply = TRUE;
+ {
+ print_reply = TRUE;
+ message_type = DBUS_MESSAGE_TYPE_METHOD_CALL;
+ }
else if (strstr (arg, "--dest=") == arg)
dest = strchr (arg, '=') + 1;
else if (strstr (arg, "--type=") == arg)
@@ -227,6 +230,18 @@ main (int argc, char *argv[])
dbus_message_iter_append_string (&iter, c);
break;
+ case DBUS_TYPE_BOOLEAN:
+ if (strcmp(c, "true") == 0)
+ dbus_message_iter_append_boolean (&iter, TRUE);
+ else if (strcmp(c, "false") == 0)
+ dbus_message_iter_append_boolean (&iter, FALSE);
+ else
+ {
+ fprintf (stderr, "%s: Expected \"true\" or \"false\" instead of \"%s\"\n", argv[0], c);
+ exit (1);
+ }
+ break;
+
default:
fprintf (stderr, "%s: Unsupported data type\n", argv[0]);
exit (1);