summaryrefslogtreecommitdiffabout
path: root/src/main.c
Unidiff
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main.c b/src/main.c
index 5fbc368..65329a4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -259,12 +259,11 @@ host_in_relayed_domain_p(char *client)
259 259
260 260
261 static void 261 static void
262set_milter_timeout(void *value) 262set_milter_timeout(union mf_option_value *val)
263{ 263{
264 time_t to = *(time_t*) value; 264 if (smfi_settimeout(val->ov_time) == MI_FAILURE) {
265 free(value); 265 mu_error(_("invalid milter timeout: %lu"),
266 if (smfi_settimeout(to) == MI_FAILURE) { 266 (unsigned long)val->ov_time);
267 mu_error(_("invalid milter timeout: %lu"), (unsigned long) to);
268 exit(EX_USAGE); 267 exit(EX_USAGE);
269 } 268 }
270} 269}
@@ -277,30 +276,31 @@ load_relay_file(void *item, void *data)
277} 276}
278 277
279static void 278static void
280set_relay(void *value) 279set_relay(union mf_option_value *val)
281{ 280{
282 mu_list_foreach(value, load_relay_file, NULL); 281 mu_list_foreach(val->ov_list, load_relay_file, NULL);
282 mu_list_destroy(&val->ov_list);
283} 283}
284 284
285void 285void
286set_stack_trace(void *value) 286set_stack_trace(union mf_option_value *val)
287{ 287{
288 stack_trace_option = (int) value; 288 stack_trace_option = val->ov_bool;
289} 289}
290 290
291static int 291static int
292option_relay(char *opt, void **pval, char *newval) 292option_relay(char const *opt, union mf_option_value *val, char const *newval)
293{ 293{
294 if (!*pval) 294 if (!val->ov_list)
295 mu_list_create((mu_list_t*)pval); 295 mu_list_create(&val->ov_list);
296 mu_list_append(*pval, strdup(newval)); 296 mu_list_append(val->ov_list, strdup(newval));
297 return 0; 297 return 0;
298} 298}
299 299
300struct mf_option_cache option_cache[] = { 300struct mf_option_cache option_cache[] = {
301 { "stack-trace", NULL, mf_option_boolean, set_stack_trace }, 301 { "stack-trace", mf_option_boolean, set_stack_trace },
302 { "milter-timeout", NULL, mf_option_time, set_milter_timeout }, 302 { "milter-timeout", mf_option_timeout, set_milter_timeout },
303 { "relay", NULL, option_relay, set_relay }, 303 { "relay", option_relay, set_relay },
304 { NULL } 304 { NULL }
305}; 305};
306 306

Return to:

Send suggestions and report system problems to the System administrator.