mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 02:35:25 +00:00
2008-06-06 Dan Williams <dcbw@redhat.com>
* system-settings/src/nm-polkit-helpers.c - (create_polkit_context): in PolicyKit 0.6, polkit_context_init() will unref the context if the initialization fails; also avoid spew when the error isn't set git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3731 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
6f30d6c0d1
commit
a7f2b61cdf
|
@ -1,3 +1,10 @@
|
|||
2008-06-06 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* system-settings/src/nm-polkit-helpers.c
|
||||
- (create_polkit_context): in PolicyKit 0.6, polkit_context_init() will
|
||||
unref the context if the initialization fails; also avoid spew when
|
||||
the error isn't set
|
||||
|
||||
2008-06-06 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Tambet Ingo <tambet@gmail.com>
|
||||
|
|
|
@ -86,10 +86,15 @@ create_polkit_context (void)
|
|||
polkit_context_set_io_watch_functions (global_context, pk_io_add_watch, pk_io_remove_watch);
|
||||
err = NULL;
|
||||
if (!polkit_context_init (global_context, &err)) {
|
||||
g_warning ("Cannot initialize libpolkit: %s", polkit_error_get_error_message (err));
|
||||
polkit_error_free (err);
|
||||
g_warning ("Cannot initialize libpolkit: %s",
|
||||
err ? polkit_error_get_error_message (err) : "unknown error");
|
||||
if (err)
|
||||
polkit_error_free (err);
|
||||
|
||||
/* PK 0.6's polkit_context_init() unrefs the global_context on failure */
|
||||
#if (POLKIT_VERSION_MAJOR == 0) && (POLKIT_VERSION_MINOR >= 7)
|
||||
polkit_context_unref (global_context);
|
||||
#endif
|
||||
global_context = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue