summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2020-03-08 05:23:42 +0100
committerAllan McRae <allan@archlinux.org>2020-03-09 05:51:38 +0100
commit0deff63efa6310ab0a00365b876eb8632abd6ab4 (patch)
treea41d09fa6ee566e095e1a5906bffba85df892615 /lib
parente578903b60081bb8a7ddd094ed67946d5e48b719 (diff)
downloadpacman-0deff63efa6310ab0a00365b876eb8632abd6ab4.tar.gz
pacman-0deff63efa6310ab0a00365b876eb8632abd6ab4.tar.xz
Remove unneeded goto cleanup
Since commit 2ee7a8d8, there is no cleanup needed in this function. Just return instead of jumping to the cleanup label. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 8ea89407..db0dba68 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -483,8 +483,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* set up fake remove transaction */
if(_alpm_remove_single_package(handle, oldpkg, newpkg, 0, 0) == -1) {
handle->pm_errno = ALPM_ERR_TRANS_ABORT;
- ret = -1;
- goto cleanup;
+ return -1;
}
}
@@ -495,15 +494,13 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
"error: could not create database entry %s-%s\n",
newpkg->name, newpkg->version);
handle->pm_errno = ALPM_ERR_DB_WRITE;
- ret = -1;
- goto cleanup;
+ return -1;
}
fd = _alpm_open_archive(db->handle, pkgfile, &buf,
&archive, ALPM_ERR_PKG_OPEN);
if(fd < 0) {
- ret = -1;
- goto cleanup;
+ return -1;
}
/* save the cwd so we can restore it later */
@@ -521,8 +518,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
close(cwdfd);
}
close(fd);
- ret = -1;
- goto cleanup;
+ return -1;
}
if(trans->flags & ALPM_TRANS_FLAG_DBONLY) {
@@ -606,8 +602,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
"error: could not update database entry %s-%s\n",
newpkg->name, newpkg->version);
handle->pm_errno = ALPM_ERR_DB_WRITE;
- ret = -1;
- goto cleanup;
+ return -1;
}
if(_alpm_db_add_pkgincache(db, newpkg) == -1) {
@@ -653,7 +648,6 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
event.type = ALPM_EVENT_PACKAGE_OPERATION_DONE;
EVENT(handle, &event);
-cleanup:
return ret;
}