aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/mmcli.c')
-rw-r--r--cli/mmcli.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/mmcli.c b/cli/mmcli.c
index 78284ca9..b05df9bc 100644
--- a/cli/mmcli.c
+++ b/cli/mmcli.c
@@ -45,6 +45,7 @@ static GCancellable *cancellable;
static gboolean verbose_flag;
static gboolean version_flag;
static gboolean async_flag;
+static gint timeout = 30; /* by default, use 30s for all operations */
static GOptionEntry main_entries[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_flag,
@@ -59,6 +60,10 @@ static GOptionEntry main_entries[] = {
"Use asynchronous methods",
NULL
},
+ { "timeout", 0, 0, G_OPTION_ARG_INT, &timeout,
+ "Timeout for the operation",
+ "[SECONDS]"
+ },
{ NULL }
};
@@ -163,6 +168,12 @@ mmcli_force_sync_operation (void)
}
}
+void
+mmcli_force_operation_timeout (GDBusProxy *proxy)
+{
+ g_dbus_proxy_set_default_timeout (proxy, timeout * 1000);
+}
+
gint
main (gint argc, gchar **argv)
{