diff options
author | David Zeuthen <davidz@redhat.com> | 2010-08-09 13:33:41 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2010-08-09 13:33:41 -0400 |
commit | 4f9bbd75a897624b16b1473c43584ed6d47f1920 (patch) | |
tree | 01686f92b10fd5a4116e188752c20500491c704a /src/programs | |
parent | 07186ab99e66aba27a10b43f834d04fbdee302ca (diff) | |
download | polkit-4f9bbd75a897624b16b1473c43584ed6d47f1920.tar.gz |
Use polkit_authority_get_sync() instead of deprecated polkit_authority_get()
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/programs')
-rw-r--r-- | src/programs/pkaction.c | 9 | ||||
-rw-r--r-- | src/programs/pkcheck.c | 9 | ||||
-rw-r--r-- | src/programs/pkexec.c | 9 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/programs/pkaction.c b/src/programs/pkaction.c index 7d8f645..2d8c90d 100644 --- a/src/programs/pkaction.c +++ b/src/programs/pkaction.c @@ -167,7 +167,14 @@ main (int argc, char *argv[]) goto out; } - authority = polkit_authority_get (); + error = NULL; + authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error); + if (authority == NULL) + { + g_printerr ("Error getting authority: %s\n", error->message); + g_error_free (error); + goto out; + } error = NULL; actions = polkit_authority_enumerate_actions_sync (authority, diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c index fbda073..fb61b33 100644 --- a/src/programs/pkcheck.c +++ b/src/programs/pkcheck.c @@ -209,7 +209,14 @@ main (int argc, char *argv[]) goto out; } - authority = polkit_authority_get (); + error = NULL; + authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error); + if (authority == NULL) + { + g_printerr ("Error getting authority: %s\n", error->message); + g_error_free (error); + goto out; + } error = NULL; flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE; diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c index b0193f4..4a3d55d 100644 --- a/src/programs/pkexec.c +++ b/src/programs/pkexec.c @@ -619,7 +619,14 @@ main (int argc, char *argv[]) goto out; } - authority = polkit_authority_get (); + error = NULL; + authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error); + if (authority == NULL) + { + g_printerr ("Error getting authority: %s\n", error->message); + g_error_free (error); + goto out; + } details = polkit_details_new (); |