diff options
author | Colin Walters <walters@verbum.org> | 2017-09-05 21:18:59 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-09-07 16:13:18 +0000 |
commit | 3c5e37329487584fb4b9c7c4e90415dab61c0b0f (patch) | |
tree | ca99dce7efbe3f85633db8ae077ee573dcd04889 /src/libostree/ostree-gpg-verifier.c | |
parent | 6578c362fe7d1a18c6622c2ba4eb8ab9257cc45e (diff) | |
download | ostree-3c5e37329487584fb4b9c7c4e90415dab61c0b0f.tar.gz |
lib/gpg: Port a few misc gpg functions to new style
I'd mostly been skipping the GPG functions due to lack of autoptr for a few
things, but I noticed these bits were straightforward.
Closes: #1136
Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-gpg-verifier.c')
-rw-r--r-- | src/libostree/ostree-gpg-verifier.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/libostree/ostree-gpg-verifier.c b/src/libostree/ostree-gpg-verifier.c index d7778cf0..9b731489 100644 --- a/src/libostree/ostree-gpg-verifier.c +++ b/src/libostree/ostree-gpg-verifier.c @@ -365,31 +365,22 @@ _ostree_gpg_verifier_add_global_keyring_dir (OstreeGpgVerifier *self, GCancellable *cancellable, GError **error) { - const char *global_keyring_path = g_getenv ("OSTREE_GPG_HOME"); - g_autoptr(GFile) global_keyring_dir = NULL; - gboolean ret = FALSE; - g_return_val_if_fail (OSTREE_IS_GPG_VERIFIER (self), FALSE); + const char *global_keyring_path = g_getenv ("OSTREE_GPG_HOME"); if (global_keyring_path == NULL) global_keyring_path = DATADIR "/ostree/trusted.gpg.d/"; if (g_file_test (global_keyring_path, G_FILE_TEST_IS_DIR)) { - global_keyring_dir = g_file_new_for_path (global_keyring_path); + g_autoptr(GFile) global_keyring_dir = g_file_new_for_path (global_keyring_path); if (!_ostree_gpg_verifier_add_keyring_dir (self, global_keyring_dir, cancellable, error)) - { - g_prefix_error (error, "Reading keyring directory '%s'", - gs_file_get_path_cached (global_keyring_dir)); - goto out; - } + return glnx_prefix_error (error, "Reading keyring directory '%s'", + gs_file_get_path_cached (global_keyring_dir)); } - ret = TRUE; - -out: - return ret; + return TRUE; } OstreeGpgVerifier* |