Commit fefa4049 authored by Colin Walters's avatar Colin Walters
Browse files

2004-08-11 Colin Walters <walters@redhat.com>

	* tools/dbus-send.c (main, usage): Add --reply-timeout
	argument.
parent eb378859
2004-08-11 Colin Walters <walters@redhat.com>
* tools/dbus-send.c (main, usage): Add --reply-timeout
argument.
2004-08-10 Olivier Andrieu <oliv__a@users.sourceforge.net>
* bus/bus.c (process_config_first_time_only): get rid of an unused
......
......@@ -30,7 +30,7 @@
static void
usage (char *name, int ecode)
{
fprintf (stderr, "Usage: %s [--help] [--system | --session] [--dest=SERVICE] [--type=TYPE] [--print-reply] <destination object path> <message name> [contents ...]\n", name);
fprintf (stderr, "Usage: %s [--help] [--system | --session] [--dest=SERVICE] [--type=TYPE] [--print-reply] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]\n", name);
exit (ecode);
}
......@@ -41,6 +41,7 @@ main (int argc, char *argv[])
DBusError error;
DBusMessage *message;
int print_reply;
int reply_timeout;
DBusMessageIter iter;
int i;
DBusBusType type = DBUS_BUS_SESSION;
......@@ -54,6 +55,7 @@ main (int argc, char *argv[])
usage (argv[0], 1);
print_reply = FALSE;
reply_timeout = -1;
for (i = 1; i < argc && name == NULL; i++)
{
......@@ -68,6 +70,11 @@ main (int argc, char *argv[])
print_reply = TRUE;
message_type = DBUS_MESSAGE_TYPE_METHOD_CALL;
}
else if (strstr (arg, "--reply-timeout=") == arg)
{
reply_timeout = strtol (strchr (arg, '=') + 1,
NULL, 10);
}
else if (strstr (arg, "--dest=") == arg)
dest = strchr (arg, '=') + 1;
else if (strstr (arg, "--type=") == arg)
......@@ -254,7 +261,7 @@ main (int argc, char *argv[])
dbus_error_init (&error);
reply = dbus_connection_send_with_reply_and_block (connection,
message, -1,
message, reply_timeout,
&error);
if (dbus_error_is_set (&error))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment