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:
parent
297cd7897b
commit
005eab0a08
1 changed files with 1 additions and 0 deletions
|
@ -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"),
|
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
|
||||||
tempfile, destfile, strerror(errno));
|
tempfile, destfile, strerror(errno));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue