mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 10:07:13 +02:00
gdbus: Add a --timeout option
Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
@@ -48,6 +48,9 @@
|
|||||||
<arg choice="plain">--dest <replaceable>bus_name</replaceable></arg>
|
<arg choice="plain">--dest <replaceable>bus_name</replaceable></arg>
|
||||||
<arg choice="plain">--object-path <replaceable>/path/to/object</replaceable></arg>
|
<arg choice="plain">--object-path <replaceable>/path/to/object</replaceable></arg>
|
||||||
<arg choice="plain">--method <replaceable>org.project.InterfaceName.MethodName</replaceable></arg>
|
<arg choice="plain">--method <replaceable>org.project.InterfaceName.MethodName</replaceable></arg>
|
||||||
|
<group>
|
||||||
|
<arg choice="plain">--timeout <replaceable>seconds</replaceable></arg>
|
||||||
|
</group>
|
||||||
<arg choice="plain">ARG1</arg>
|
<arg choice="plain">ARG1</arg>
|
||||||
<arg choice="plain" rep="repeat">ARG2</arg>
|
<arg choice="plain" rep="repeat">ARG2</arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
|
@@ -527,12 +527,14 @@ _g_variant_parse_me_harder (GVariantType *type,
|
|||||||
static gchar *opt_call_dest = NULL;
|
static gchar *opt_call_dest = NULL;
|
||||||
static gchar *opt_call_object_path = NULL;
|
static gchar *opt_call_object_path = NULL;
|
||||||
static gchar *opt_call_method = NULL;
|
static gchar *opt_call_method = NULL;
|
||||||
|
static gint opt_call_timeout = -1;
|
||||||
|
|
||||||
static const GOptionEntry call_entries[] =
|
static const GOptionEntry call_entries[] =
|
||||||
{
|
{
|
||||||
{ "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_call_dest, N_("Destination name to invoke method on"), NULL},
|
{ "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_call_dest, N_("Destination name to invoke method on"), NULL},
|
||||||
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_call_object_path, N_("Object path to invoke method on"), NULL},
|
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_call_object_path, N_("Object path to invoke method on"), NULL},
|
||||||
{ "method", 'm', 0, G_OPTION_ARG_STRING, &opt_call_method, N_("Method and interface name"), NULL},
|
{ "method", 'm', 0, G_OPTION_ARG_STRING, &opt_call_method, N_("Method and interface name"), NULL},
|
||||||
|
{ "timeout", 't', 0, G_OPTION_ARG_INT, &opt_call_timeout, N_("Timeout in seconds"), NULL},
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -809,7 +811,7 @@ handle_call (gint *argc,
|
|||||||
parameters,
|
parameters,
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
opt_call_timeout > 0 ? opt_call_timeout * 1000 : opt_call_timeout,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
|
Reference in New Issue
Block a user