1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-01 09:51:50 -05:00

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>
This commit is contained in:
Lukas Fleischer 2011-07-24 13:52:05 +02:00 committed by Dan McGee
parent 297cd7897b
commit 005eab0a08

View File

@ -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;