summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-12 08:57:26 -0500
committerDan McGee <dan@archlinux.org>2012-04-12 08:57:26 -0500
commitd7b728591ad68712be2c0ade7c2dd8e45bc2dfed (patch)
tree679076addb5e80513151236151c4735e75cdee48 /lib
parent6a8e50a69ec419cc95ee513cd2e73944c4ac57f9 (diff)
parentded66fbb62cdad37d577dc048e37f7cea7f7a4da (diff)
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/dload.c11
-rw-r--r--lib/libalpm/signing.c4
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index b3ac024c..49bfa26f 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -335,9 +335,9 @@ static void mask_signal(int signal, void (*handler)(int),
sigaction(signal, &newaction, NULL);
}
-static void unmask_signal(int signal, struct sigaction sa)
+static void unmask_signal(int signal, struct sigaction *sa)
{
- sigaction(signal, &sa, NULL);
+ sigaction(signal, sa, NULL);
}
static FILE *create_tempfile(struct dload_payload *payload, const char *localpath)
@@ -405,7 +405,8 @@ static int curl_download_internal(struct dload_payload *payload,
RET_ERR(handle, ALPM_ERR_SERVER_BAD_URL, -1);
}
- if(strlen(payload->remote_name) > 0 && strcmp(payload->remote_name, ".sig") != 0) {
+ if(payload->remote_name && strlen(payload->remote_name) > 0 &&
+ strcmp(payload->remote_name, ".sig") != 0) {
payload->destfile_name = get_fullpath(localpath, payload->remote_name, "");
payload->tempfile_name = get_fullpath(localpath, payload->remote_name, ".part");
if(!payload->destfile_name || !payload->tempfile_name) {
@@ -582,8 +583,8 @@ cleanup:
}
/* restore the old signal handlers */
- unmask_signal(SIGINT, orig_sig_int);
- unmask_signal(SIGPIPE, orig_sig_pipe);
+ unmask_signal(SIGINT, &orig_sig_int);
+ unmask_signal(SIGPIPE, &orig_sig_pipe);
/* if we were interrupted, trip the old handler */
if(dload_interrupted) {
raise(SIGINT);
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 018b1cca..1e417164 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -208,9 +208,9 @@ static int key_in_keychain(alpm_handle_t *handle, const char *fpr)
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
}
+ gpgme_key_unref(key);
error:
- gpgme_key_unref(key);
gpgme_release(ctx);
return ret;
}
@@ -812,7 +812,7 @@ int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier,
_("%s: key \"%s\" is unknown\n"), identifier, name);
#ifdef HAVE_LIBGPGME
{
- int answer;
+ int answer = 0;
alpm_pgpkey_t fetch_key;
memset(&fetch_key, 0, sizeof(fetch_key));