diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-11-09 15:55:16 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-11-09 15:55:16 +0000 |
commit | d605191773c6b534a05f63566fd668bcdb15b302 (patch) | |
tree | e13cea8a0353688497c43e77b3e7aba9a8337848 | |
parent | 55300dc8daf5e759680092759e44761d82d65608 (diff) | |
download | mailfromd-d605191773c6b534a05f63566fd668bcdb15b302.tar.gz mailfromd-d605191773c6b534a05f63566fd668bcdb15b302.tar.bz2 |
(lock_retry_count_option,
lock_retry_timeout_option): New variables
(set_lock_retry_count,set_lock_retry_timeout): Set variables
instead of calling mu_locker_set_* functions
(option_email): Forgotten to commit yesterday
git-svn-id: file:///svnroot/mailfromd/branches/release_3_0_patches@834 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | src/main.c | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -37,7 +37,6 @@ #include <mailutils/mailutils.h> #include <mailutils/argp.h> -#include <mailutils/locker.h> #include "mailfrom.h" @@ -88,6 +87,8 @@ int ignore_failed_reads_option; /* Ignore failed reads while compacting or expiring */ int all_option; /* Process all databases */ char *time_format_string = "%c"; /* String to format the time stamps */ +size_t lock_retry_count_option = 3; +time_t lock_retry_timeout_option = 1; /* DBM-related options end */ int source_info_option; /* Debug messages include source locations */ @@ -484,7 +485,7 @@ void set_lock_retry_count(void *value) { #ifdef USE_DBM - mu_locker_set_default_retry_count(strtoul(value, NULL, 0)); + lock_retry_count_option = strtoul(value, NULL, 0); #endif } @@ -492,7 +493,7 @@ void set_lock_retry_timeout(void *value) { #ifdef USE_DBM - mu_locker_set_default_retry_timeout(*(time_t*) value); + lock_retry_timeout_option = *(time_t*) value; free(value); #endif } @@ -575,10 +576,20 @@ option_time(char *opt, void **pval, char *newval) int option_email(char *opt, void **pval, char *newval) { - if (newval[0] == 0 || strchr(newval, '@')) - return option_string(opt, pval, newval); - errno = EINVAL; - return 1; + int rc; + mu_address_t addr; + + /* FIXME-MU: compensate for mailutils deficiency */ + if (newval[0] == 0) + newval = "<>"; + rc = mu_address_create(&addr, newval); + if (rc) { + mu_error("cannot create address `%s': %s", + newval, mu_strerror(rc)); + return 1; + } + mu_address_destroy(&addr); + return option_string(opt, pval, newval); } int @@ -1325,11 +1336,6 @@ db_format_setup() cache_format = db_format_install(cache_format); rate_format = db_format_install(rate_format); greylist_format = db_format_install(greylist_format); - - mu_locker_set_default_flags (MU_LOCKER_KERNEL|MU_LOCKER_RETRY, - mu_locker_assign); - mu_locker_set_default_retry_timeout (1); - mu_locker_set_default_retry_count (3); #endif } |