From 90e4ba15bcc605bd4d70abbddc0b7103bc0a3b2f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 23 May 2019 10:58:35 +0200 Subject: [PATCH] dispatcher: move global variable ever_aquired_name into "gl" struct --- dispatcher/nm-dispatcher.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dispatcher/nm-dispatcher.c b/dispatcher/nm-dispatcher.c index a666ef7194..3c6c097c8c 100644 --- a/dispatcher/nm-dispatcher.c +++ b/dispatcher/nm-dispatcher.c @@ -42,6 +42,7 @@ static struct { gboolean persist; guint quit_id; guint request_id_counter; + gboolean ever_acquired_name; } gl; typedef struct Request Request; @@ -869,14 +870,12 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, return TRUE; } -static gboolean ever_acquired_name = FALSE; - static void on_name_acquired (GDBusConnection *connection, const char *name, gpointer user_data) { - ever_acquired_name = TRUE; + gl.ever_acquired_name = TRUE; } static void @@ -885,14 +884,14 @@ on_name_lost (GDBusConnection *connection, gpointer user_data) { if (!connection) { - if (!ever_acquired_name) { + if (!gl.ever_acquired_name) { _LOG_X_W ("Could not get the system bus. Make sure the message bus daemon is running!"); exit (1); } else { _LOG_X_I ("System bus stopped. Exiting"); exit (0); } - } else if (!ever_acquired_name) { + } else if (!gl.ever_acquired_name) { _LOG_X_W ("Could not acquire the " NM_DISPATCHER_DBUS_SERVICE " service."); exit (1); } else {