From 3a59cbd0b7b9c5dd3c62ac1679876070c264d80f Mon Sep 17 00:00:00 2001 From: Michal Zidek Date: Wed, 15 Aug 2012 10:56:21 +0200 Subject: Unify usage of sysdb transactions (part 2). --- src/db/sysdb_sudo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/db/sysdb_sudo.c') diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c index 8a9539492..e1434e254 100644 --- a/src/db/sysdb_sudo.c +++ b/src/db/sysdb_sudo.c @@ -607,6 +607,7 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); goto done; } in_transaction = true; @@ -627,9 +628,11 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, } ret = sysdb_transaction_commit(sysdb); - if (ret == EOK) { - in_transaction = false; + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + goto done; } + in_transaction = false; done: if (in_transaction) { -- cgit