From 6b7b9787d52ac5e7f36ba18f697bb727d43c4915 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Mon, 10 Oct 2005 15:03:35 +0000 Subject: - more sanity checks - alpm_pkg_free can now return an error code --- lib/libalpm/trans.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/trans.c') 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) { -- cgit v1.2.3-70-g09d2