dbus/tools dbus-send.c,1.7,1.8

Havoc Pennington hp at pdx.freedesktop.org
Fri Mar 26 21:29:33 PST 2004


Update of /cvs/dbus/dbus/tools
In directory pdx:/tmp/cvs-serv27130/tools

Modified Files:
	dbus-send.c 
Log Message:
2004-03-27  Havoc Pennington  <hp at 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
	


Index: dbus-send.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-send.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- a/dbus-send.c	10 Oct 2003 02:42:21 -0000	1.7
+++ b/dbus-send.c	27 Mar 2004 05:29:31 -0000	1.8
@@ -64,7 +64,10 @@
       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 @@
 	  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);




More information about the dbus-commit mailing list