Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-13 21:16:49 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-13 21:16:49 +0000
commitb014cdbe8b777e29d39fe52ff0bdeebfa1f8c216 (patch)
treea0d8cdf62a862ffbfb6d3bdd1fa0c6735128f378 /src
parente3cc4150f6ccf915aaa60418b520832deb9c49d9 (diff)
code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/pacman/add.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pacman/add.c b/src/pacman/add.c
index 10c618eb..aa65a139 100644
--- a/src/pacman/add.c
+++ b/src/pacman/add.c
@@ -70,7 +70,7 @@ int pacman_add(list_t *targets)
for(i = targets; i; i = i->next) {
if(alpm_trans_addtarget(i->data) == -1) {
ERR(NL, "failed to add target '%s' (%s)\n", (char *)i->data, alpm_strerror(pm_errno));
- return(1);
+ goto error;
}
}
MSG(CL, "done.");
@@ -116,18 +116,23 @@ int pacman_add(list_t *targets)
default:
break;
}
- alpm_trans_release();
- return(1);
+ goto error;
}
/* Step 3: actually perform the installation
*/
if(alpm_trans_commit(NULL) == -1) {
ERR(NL, "failed to commit transaction (%s)\n", alpm_strerror(pm_errno));
- return(1);
+ goto error;
}
return(0);
+
+error:
+ if(alpm_trans_release() == -1) {
+ ERR(NL, "failed to release transaction (%s)\n", alpm_strerror(pm_errno));
+ }
+ return(1);
}
/* vim: set ts=2 sw=2 noet: */