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
@@ -92,7 +92,7 @@ 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; @@ -652,6 +652,12 @@ 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) { @@ -844,6 +850,7 @@ struct 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 }, @@ -939,6 +946,7 @@ enum mailfromd_option { OPTION_PREDICT_NEXT, OPTION_SHOW_DEFAULTS, OPTION_SINGLE_PROCESS, + OPTION_STACK_TRACE, OPTION_SOURCE_INFO, OPTION_SYSLOG, OPTION_TIME_FORMAT, @@ -1085,6 +1093,8 @@ static struct argp_option options[] = { 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*/ @@ -1347,6 +1357,10 @@ parse_opt (int key, char *arg, struct argp_state *state) 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; |