summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-07-24 13:52:05 +0200
committerDan McGee <dan@archlinux.org>2011-07-25 08:48:02 -0500
commit005eab0a080925d0d6f780d751f9019dafbafc64 (patch)
treeb2318e9248de7a521ad81478a24a5a30899217a4 /lib/libalpm
parent297cd7897bfe060ce46d703e15ad7cbe37aedced (diff)
downloadpacman-005eab0a080925d0d6f780d751f9019dafbafc64.tar.xz
libalpm: Set ret correctly in download_internal()
Immediately jump to the cleanup code after setting the return code to -1 in case rename() fails. Otherwise, it will be reset to 0 right after we leave the if branch. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/dload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index a98d84ac..e3d30f23 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -308,6 +308,7 @@ static int download_internal(const char *url, const char *localpath,
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
tempfile, destfile, strerror(errno));
ret = -1;
+ goto cleanup;
}
ret = 0;