aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main.c b/src/main.c
index 5fbc3682..65329a42 100644
--- a/src/main.c
+++ b/src/main.c
@@ -256,54 +256,54 @@ host_in_relayed_domain_p(char *client)
256 free(hbuf); 256 free(hbuf);
257 return rc; 257 return rc;
258} 258}
259 259
260 260
261static void 261static 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}
271 270
272static int 271static int
273load_relay_file(void *item, void *data) 272load_relay_file(void *item, void *data)
274{ 273{
275 read_domain_file(item); 274 read_domain_file(item);
276 return 0; 275 return 0;
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
307 307
308/* Command line parsing */ 308/* Command line parsing */
309 309

Return to:

Send suggestions and report system problems to the System administrator.