summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-10 15:03:35 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-10 15:03:35 +0000
commit6b7b9787d52ac5e7f36ba18f697bb727d43c4915 (patch)
treedeed2b10bd0519d6b7c86d5cadc825518c836217 /lib/libalpm/trans.c
parent5d61a44759dee774e67178097c2f8acffe12836f (diff)
- more sanity checks
- alpm_pkg_free can now return an error code
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 12d35806..7a91cb9b 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -81,9 +81,7 @@ void trans_free(pmtrans_t *trans)
int trans_init(pmtrans_t *trans, unsigned char type, unsigned char flags, alpm_trans_cb_event event, alpm_trans_cb_conv conv)
{
/* Sanity checks */
- if(trans == NULL) {
- RET_ERR(PM_ERR_TRANS_NULL, -1);
- }
+ ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
/* ORE
perform sanity checks on type and flags:
@@ -148,7 +146,7 @@ int trans_prepare(pmtrans_t *trans, PMList **data)
*data = NULL;
/* Sanity checks */
- ASSERT(trans != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
/* If there's nothing to do, return without complaining */
if(trans->packages == NULL) {
@@ -185,7 +183,7 @@ int trans_prepare(pmtrans_t *trans, PMList **data)
int trans_commit(pmtrans_t *trans)
{
/* Sanity checks */
- ASSERT(trans != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
/* If there's nothing to do, return without complaining */
if(trans->packages == NULL) {