aboutsummaryrefslogtreecommitdiff
path: root/src/bi_db.m4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-11-08 17:58:44 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-11-08 17:58:44 +0000
commit507d4c61a65199f1aa5076f68ab053ae13e081ad (patch)
treeac385b67c6d98d9ae1aa32c05004e7bdbae6abf3 /src/bi_db.m4
parent7e77e40dacddf089d0cdb0033da5cf33d21afe9e (diff)
downloadmailfromd-507d4c61a65199f1aa5076f68ab053ae13e081ad.tar.gz
mailfromd-507d4c61a65199f1aa5076f68ab053ae13e081ad.tar.bz2
Use catch/assert macros.
git-svn-id: file:///svnroot/mailfromd/trunk@818 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/bi_db.m4')
-rw-r--r--src/bi_db.m419
1 files changed, 7 insertions, 12 deletions
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index f8bc7cb2..897f0867 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -103,12 +103,10 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
if (prog_trace_option)
prog_trace(env, "GREYLIST %s %ld %ld", email, interval);
- if (mu_dbm_open(greylist_format->dbname, &db, MU_STREAM_RDWR, 0600)) {
- if (env_catch(env, mf_dbfailure) == 0)
- return;
- runtime_error(env, "mu_dbm_open(%s) failed: %s",
+ rc = mu_dbm_open(greylist_format->dbname, &db, MU_STREAM_RDWR, 0600);
+ MF_ASSERT(rc == 0, mf_dbfailure, "mu_dbm_open(%s) failed: %s",
greylist_format->dbname, mu_strerror(errno));
- }
+
readonly = mu_dbm_lock(&db);
memset(&key, 0, sizeof key);
@@ -120,13 +118,10 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
if (mu_dbm_fetch(&db, key, &contents) == 0) {
time_t timestamp, diff;
- if (MU_DATUM_SIZE(contents) != sizeof timestamp) {
- if (env_catch(env, mf_dbfailure) == 0)
- return;
- runtime_error(env,
- "greylist database %s has wrong data size",
- greylist_format->dbname);
- }
+ MF_ASSERT(MU_DATUM_SIZE(contents) == sizeof timestamp,
+ mf_dbfailure,
+ "greylist database %s has wrong data size",
+ greylist_format->dbname);
timestamp = *(time_t*) MU_DATUM_PTR(contents);
diff = now - timestamp;

Return to:

Send suggestions and report system problems to the System administrator.