diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-04-18 07:33:39 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-04-18 07:33:39 +0000 |
commit | 71d23052e4bbb16978a2c38e151d2cbf71320e9d (patch) | |
tree | 2022ce3e3ed8b5438ac2b9e0fcd97c88691806a0 /src/main.c | |
parent | 9a1ddf916e38a3ed89d8d306997efe008a3b95b6 (diff) | |
download | mailfromd-71d23052e4bbb16978a2c38e151d2cbf71320e9d.tar.gz mailfromd-71d23052e4bbb16978a2c38e151d2cbf71320e9d.tar.bz2 |
Implement stack traces
git-svn-id: file:///svnroot/mailfromd/trunk@1363 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -89,13 +89,13 @@ 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 */ - +int stack_trace_option; /* Print stack traces on runtime errors */ char *file_option; /* File name for DB management commands */ struct db_format *format_option; /* Connect settings */ time_t connect_timeout = 10; @@ -649,12 +649,18 @@ set_group(void *value) void set_source_info(void *value) { source_info_option = (int) value; } +void +set_stack_trace(void *value) +{ + stack_trace_option = (int) value; +} + static void set_lock_retry_count(void *value) { lock_retry_count_option = strtoul(value, NULL, 0); } @@ -841,12 +847,13 @@ struct option_cache { void (*set)(void *value); int cumulative; } option_cache[] = { { "ehlo", NULL, option_ehlo, set_ehlo }, { "debug", NULL, option_debug, set_debug }, { "source-info", NULL, option_boolean, set_source_info }, + { "stack-trace", NULL, option_boolean, set_stack_trace }, { "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 }, @@ -936,12 +943,13 @@ enum mailfromd_option { OPTION_MILTER_TIMEOUT, OPTION_PIDFILE, OPTION_POSTMASTER_EMAIL, OPTION_PREDICT_NEXT, OPTION_SHOW_DEFAULTS, OPTION_SINGLE_PROCESS, + OPTION_STACK_TRACE, OPTION_SOURCE_INFO, OPTION_SYSLOG, OPTION_TIME_FORMAT, OPTION_TIMEOUT, OPTION_TRACE, OPTION_TRACE_PROGRAM, @@ -1082,12 +1090,14 @@ static struct argp_option options[] = { { "syslog", OPTION_SYSLOG, NULL, 0, N_("Log to syslog (default)"), GRP+1 }, { "log-tag", OPTION_LOG_TAG, N_("STRING"), 0, N_("Set the identifier used in syslog messages to STRING"), GRP+1 }, { "source-info", OPTION_SOURCE_INFO, NULL, 0, N_("Debug messages include source information"), GRP+1 }, + { "stack-trace", OPTION_STACK_TRACE, NULL, 0, + N_("Enable stack traces on runtime errors"), GRP+1 }, #undef GRP /*DEPRECATED OPTIONS*/ { "domain", 'D', N_("STRING"), OPTION_HIDDEN, "", 1 }, { "ehlo", 0, NULL, OPTION_ALIAS|OPTION_HIDDEN, NULL, 1 }, { "postmaster-email", OPTION_POSTMASTER_EMAIL, N_("EMAIL"), @@ -1344,12 +1354,16 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case OPTION_SINGLE_PROCESS: single_process_option = 1; break; + case OPTION_STACK_TRACE: + set_option("stack-trace", "yes", 1); + break; + case OPTION_SOURCE_INFO: set_option("source-info", "yes", 1); break; case OPTION_SYSLOG: log_to_stderr = 0; |