From 1e5977b62f896e844b548c3007ace9e1dfa7f9ed Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 11 Apr 2020 21:28:04 +0200 Subject: New upstream version 1.23.90 --- clients/nm-online.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'clients/nm-online.c') diff --git a/clients/nm-online.c b/clients/nm-online.c index de9c3794..5950da56 100644 --- a/clients/nm-online.c +++ b/clients/nm-online.c @@ -23,6 +23,8 @@ #include #include +#include "nm-libnm-aux/nm-libnm-aux.h" + #define PROGRESS_STEPS 15 #define EXIT_NONE -1 @@ -198,13 +200,16 @@ got_client (GObject *source_object, GAsyncResult *res, gpointer user_data) { OnlineData *data = user_data; gs_free_error GError *error = NULL; - NMClient *client; + + nm_assert (NM_IS_CLIENT (source_object)); + nm_assert (NM_CLIENT (source_object) == data->client); nm_clear_g_source (&data->client_new_timeout_id); g_clear_object (&data->client_new_cancellable); - client = nm_client_new_finish (res, &error); - if (!client) { + if (!g_async_initable_init_finish (G_ASYNC_INITABLE (source_object), + res, + &error)) { if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; data->quiet = TRUE; @@ -214,8 +219,6 @@ got_client (GObject *source_object, GAsyncResult *res, gpointer user_data) return; } - data->client = client; - if (quit_if_connected (data)) return; @@ -285,7 +288,12 @@ main (int argc, char *argv[]) data.client_new_cancellable = g_cancellable_new (); data.client_new_timeout_id = g_timeout_add_seconds (30, got_client_timeout, &data); - nm_client_new_async (data.client_new_cancellable, got_client, &data); + + data.client = nmc_client_new_async (data.client_new_cancellable, + got_client, + &data, + NM_CLIENT_INSTANCE_FLAGS, (guint) NM_CLIENT_INSTANCE_FLAGS_NO_AUTO_FETCH_PERMISSIONS, + NULL); g_main_loop_run (data.loop); @@ -295,7 +303,7 @@ main (int argc, char *argv[]) nm_clear_g_signal_handler (data.client, &data.client_notify_id); g_clear_object (&data.client); - g_clear_pointer (&data.loop, g_main_loop_unref); + nm_clear_pointer (&data.loop, g_main_loop_unref); if (!data.quiet) _print_progress (data.wait_startup, -1, NM_MAX (0, data.end_timestamp_ms - _now_ms ()), data.retval); -- cgit 1.3.0-6-gf8a5 From d460892bbfece74fb6d3cd846bf6ef548290be41 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 8 May 2020 21:40:53 +0200 Subject: New upstream version 1.24.0 --- clients/nm-online.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clients/nm-online.c') diff --git a/clients/nm-online.c b/clients/nm-online.c index 5950da56..8370f964 100644 --- a/clients/nm-online.c +++ b/clients/nm-online.c @@ -233,7 +233,7 @@ main (int argc, char *argv[]) OnlineData data = { .retval = EXIT_FAILURE_UNSPECIFIED, }; - int t_secs = 30; + int t_secs; GOptionContext *opt_ctx = NULL; gboolean success; GOptionEntry options[] = { @@ -251,6 +251,8 @@ main (int argc, char *argv[]) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); + t_secs = _nm_utils_ascii_str_to_int64 (g_getenv ("NM_ONLINE_TIMEOUT"), 10, 0, G_MAXINT, 30); + data.start_timestamp_ms = _now_ms (); opt_ctx = g_option_context_new (NULL); -- cgit 1.3.0-6-gf8a5