From 813578196f08c599c7e87c45aff808db0148303d Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Wed, 20 Oct 2010 19:39:02 +0300 Subject: [PATCH] udisks: Avoid deprecated polkit_authority_get() function Use polkit_authority_get_sync() instead. This was introduced in polkit-1 commit 322513b0d, thus bump the configure.ac check to 0.97. Signed-off-by: Martin Pitt --- configure.ac | 4 ++-- src/daemon.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a9141bf..77ebf7d 100644 --- a/configure.ac +++ b/configure.ac @@ -151,11 +151,11 @@ PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.82]) AC_SUBST(DBUS_GLIB_CFLAGS) AC_SUBST(DBUS_GLIB_LIBS) -PKG_CHECK_MODULES(POLKIT_GOBJECT_1, [polkit-gobject-1 >= 0.92]) +PKG_CHECK_MODULES(POLKIT_GOBJECT_1, [polkit-gobject-1 >= 0.97]) AC_SUBST(POLKIT_GOBJECT_1_CFLAGS) AC_SUBST(POLKIT_GOBJECT_1_LIBS) -PKG_CHECK_MODULES(POLKIT_BACKEND_1, [polkit-backend-1 >= 0.92]) +PKG_CHECK_MODULES(POLKIT_BACKEND_1, [polkit-backend-1 >= 0.97]) AC_SUBST(POLKIT_BACKEND_1_CFLAGS) AC_SUBST(POLKIT_BACKEND_1_LIBS) diff --git a/src/daemon.c b/src/daemon.c index d46c6da..afcd8fb 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -1794,7 +1794,16 @@ register_disks_daemon (Daemon *daemon) "sas_expander", /* SAS Expanders */ NULL }; - daemon->priv->authority = polkit_authority_get (); + daemon->priv->authority = polkit_authority_get_sync ((GCancellable *) NULL, &error); + if (daemon->priv->authority == NULL) + { + if (error != NULL) + { + g_critical ("error getting authority reference: %s", error->message); + g_error_free (error); + } + goto error; + } error = NULL; daemon->priv->system_bus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); -- 2.7.4