aboutsummaryrefslogtreecommitdiff
path: root/lib/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils.c')
-rw-r--r--lib/utils.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/lib/utils.c b/lib/utils.c
index 3fc123a3..6a19e505 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -114,16 +114,6 @@ config_cb_timeout (struct timeval *pt, mu_config_value_t *val)
}
int
-config_cb_time_t(void *data, mu_config_value_t *arg)
-{
- struct timeval tv;
- int rc = config_cb_timeout (&tv, arg);
- if (rc == 0)
- *(time_t*) data = tv.tv_sec;
- return rc;
-}
-
-int
config_cb_ignore(void *data, mu_config_value_t *val)
{
mu_diag_output (MU_DIAG_WARNING,
@@ -135,53 +125,36 @@ config_cb_ignore(void *data, mu_config_value_t *val)
int
config_cb_lock_retry_count(void *data, mu_config_value_t *val)
{
- char *p;
- size_t n;
-
if (mu_cfg_assert_value_type(val, MU_CFG_STRING))
return 1;
- n = strtoul(val->v.string, &p, 10);
- if (*p) {
+ if (mf_optcache_set_option("lock-retry-count", val->v.string)) {
mu_error(_("not a number"));
return 1;
}
- mf_optcache_set_option("lock-retry-count", (void*)&n);
return 0;
}
int
config_cb_lock_retry_timeout(void *data, mu_config_value_t *val)
{
- int rc;
- time_t t;
-
- rc = config_cb_time_t(&t, val);
- if (rc == 0)
- mf_optcache_set_option("lock-retry-timeout", (void*)&t);
- return rc;
+ return mf_optcache_set_option("lock-retry-timeout", val->v.string);
}
static void
-set_lock_retry_count(void *value)
+set_lock_retry_count(union mf_option_value *val)
{
- size_t *n = value;
- mu_locker_set_default_retry_count(*n);
- free(value);
+ mu_locker_set_default_retry_count(val->ov_size);
}
static void
-set_lock_retry_timeout(void *value)
+set_lock_retry_timeout(union mf_option_value *val)
{
- time_t *t = value;
- mu_locker_set_default_retry_timeout(*t);
- free(value);
+ mu_locker_set_default_retry_timeout(val->ov_time);
}
static struct mf_option_cache lock_option_cache[] = {
- { "lock-retry-count", NULL, mf_option_size_t,
- set_lock_retry_count },
- { "lock-retry-timeout", NULL, mf_option_time_t,
- set_lock_retry_timeout },
+ { "lock-retry-count", mf_option_size, set_lock_retry_count },
+ { "lock-retry-timeout", mf_option_timeout, set_lock_retry_timeout },
{ NULL }
};

Return to:

Send suggestions and report system problems to the System administrator.