aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-01-19 16:13:15 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-01-19 16:13:15 +0000
commitc2b3fb08428a37fc502916f3efa512ccbcc301e0 (patch)
tree055a1726682bccdee2e35e0192fa0ed9e5e05f74
parentff723b1bf837d8a8fa09798fd844184e32fe24d3 (diff)
downloadmailfromd-c2b3fb08428a37fc502916f3efa512ccbcc301e0.tar.gz
mailfromd-c2b3fb08428a37fc502916f3efa512ccbcc301e0.tar.bz2
(struct option_cache): New member `cumulative'.
(set_option): Do not check override for cumulative options. git-svn-id: file:///svnroot/mailfromd/branches/v_1_0@210 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--src/main.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index fdd2bb46..445eef93 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1076,21 +1076,22 @@ struct option_cache {
void *value;
int (*handler)(char *opt, void **pval, char *newval);
void (*set)(void *value);
+ int cumulative;
} option_cache[] = {
- { "ehlo", NULL, option_string, set_ehlo },
- { "debug", NULL, option_debug, set_debug },
- { "expire-interval", NULL, option_time, set_expire },
- { "positive-expire-interval", NULL, option_time, set_positive_expire },
- { "negative-expire-interval", NULL, option_time, set_negative_expire },
- { "rates-expire-interval", NULL, option_time, set_rates_expire },
- { "port", NULL, option_string, set_port }, /* FIXME: option_port */
- { "user", NULL, option_string, set_user },
- { "milter-timeout", NULL, option_time, set_milter_timeout },
- { "pidfile", NULL, option_pidfile, set_pidfile },
- { "mailfrom", NULL, option_email, set_mailfrom },
- { "retry", NULL, option_number, set_retry },
- { "timeout", NULL, option_time, set_timeout },
- { "relay", NULL, option_relay, set_relay },
+ { "ehlo", NULL, option_string, set_ehlo, 0 },
+ { "debug", NULL, option_debug, set_debug, 0 },
+ { "expire-interval", NULL, option_time, set_expire, 0 },
+ { "positive-expire-interval", NULL, option_time, set_positive_expire, 0 },
+ { "negative-expire-interval", NULL, option_time, set_negative_expire, 0 },
+ { "rates-expire-interval", NULL, option_time, set_rates_expire, 0 },
+ { "port", NULL, option_string, set_port, 0 }, /* FIXME: option_port */
+ { "user", NULL, option_string, set_user, 0 },
+ { "milter-timeout", NULL, option_time, set_milter_timeout, 0 },
+ { "pidfile", NULL, option_pidfile, set_pidfile, 0 },
+ { "mailfrom", NULL, option_email, set_mailfrom, 0 },
+ { "retry", NULL, option_number, set_retry, 0 },
+ { "timeout", NULL, option_time, set_timeout, 0 },
+ { "relay", NULL, option_relay, set_relay, 1 },
{ NULL }
};
@@ -1113,7 +1114,7 @@ set_option(char *name, char *value, int override)
errno = ENOENT;
return 1;
}
- if (!override && p->value)
+ if (!p->cumulative && !override && p->value)
return 0;
return p->handler(name, &p->value, value);
}

Return to:

Send suggestions and report system problems to the System administrator.