Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check for polkit_authority_get_sync

polkit_authority_get_sync does not exist in policykit 0.96 which is still
widely used. Use the depricated function polkit_authority_get on older
versions.
  • Loading branch information...
commit 30d819c07b3826665cf6cff331dafdc15e3e3328 1 parent 0cee86c
@poelzi authored
Showing with 9 additions and 0 deletions.
  1. +4 −0 CMakeLists.txt
  2. +1 −0  src/config.h.tmpl
  3. +4 −0 src/core.c
View
4 CMakeLists.txt
@@ -34,6 +34,10 @@ endif(ENABLE_DBUS)
pkg_check_modules(GIO gio-2.0 REQUIRED)
+if(POLKIT_FOUND)
+ INCLUDE (CheckLibraryExists)
+ CHECK_LIBRARY_EXISTS(polkit-gobject-1 polkit_authority_get_sync "" POLKIT_HAVE_GET_SYNC)
+endif(POLKIT_FOUND)
# FIXME: libproc should export more symbols
# find libproc
View
1  src/config.h.tmpl
@@ -29,6 +29,7 @@
#cmakedefine ENABLE_DBUS
#cmakedefine DEVELOP_DBUS_SESSION
#cmakedefine POLKIT_FOUND
+#cmakedefine POLKIT_HAVE_GET_SYNC
#cmakedefine DEVELOP_MODE
#ifdef DEVELOP_MODE
#define RELEASE_AGENT ${CMAKE_CURRENT_BINARY_DIR}/src/ulatencyd_cleanup.lua
View
4 src/core.c
@@ -1809,7 +1809,11 @@ int core_init() {
#endif
#ifdef POLKIT_FOUND
+#ifdef POLKIT_HAVE_GET_SYNC
U_polkit_authority = polkit_authority_get_sync (NULL, NULL);
+#else
+ U_polkit_authority = polkit_authority_get();
+#endif
#endif
// delay stack
delay_stack = g_ptr_array_new_with_free_func(free);
Please sign in to comment.
Something went wrong with that request. Please try again.