diff options
author | Vincent Mihalkovic <vmihalko@redhat.com> | 2022-04-06 15:36:09 +0000 |
---|---|---|
committer | Jan Rybar <jrybar@redhat.com> | 2022-04-06 15:36:09 +0000 |
commit | 3583a1d25a50f68fa67d2ec0866e2c5e1bb23710 (patch) | |
tree | 160d549d6cf03a3f96ed0974a6261e63be39d804 /src | |
parent | abbc04f6f3acfc2dfa34b1c07decaa658786e142 (diff) | |
download | polkit-3583a1d25a50f68fa67d2ec0866e2c5e1bb23710.tar.gz |
polkitd: consider connection to the system bus in return value
Diffstat (limited to 'src')
-rw-r--r-- | src/polkitbackend/polkitd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/polkitbackend/polkitd.c b/src/polkitbackend/polkitd.c index 6c57151..c3ec32f 100644 --- a/src/polkitbackend/polkitd.c +++ b/src/polkitbackend/polkitd.c @@ -37,6 +37,7 @@ static PolkitBackendAuthority *authority = NULL; static gpointer registration_id = NULL; static GMainLoop *loop = NULL; +static gint exit_status = EXIT_FAILURE; static gboolean opt_replace = FALSE; static gboolean opt_no_debug = FALSE; static GOptionEntry opt_entries[] = { @@ -84,6 +85,8 @@ on_name_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { + exit_status = EXIT_SUCCESS; + polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Acquired the name org.freedesktop.PolicyKit1 on the system bus"); } @@ -159,11 +162,9 @@ main (int argc, { GError *error; GOptionContext *opt_context; - gint ret; guint name_owner_id; guint sigint_id; - ret = 1; loop = NULL; opt_context = NULL; name_owner_id = 0; @@ -237,8 +238,6 @@ main (int argc, g_print ("Entering main event loop\n"); g_main_loop_run (loop); - ret = 0; - g_print ("Shutting down\n"); out: if (sigint_id > 0) @@ -254,6 +253,6 @@ main (int argc, if (opt_context != NULL) g_option_context_free (opt_context); - g_print ("Exiting with code %d\n", ret); - return ret; + g_print ("Exiting with code %d\n", exit_status); + return exit_status; } |