diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-26 16:01:36 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-28 09:39:41 +0300 |
commit | bf265f7494edf4d831d52f0333702a01fb45b612 (patch) | |
tree | 8f222ddaa42357b65ca150837eccf0790222f02d /src/log.c | |
parent | fc6c9684cc5a63c3d03aed3df201e89b4257f368 (diff) | |
download | connman-bf265f7494edf4d831d52f0333702a01fb45b612.tar.gz connman-bf265f7494edf4d831d52f0333702a01fb45b612.tar.bz2 connman-bf265f7494edf4d831d52f0333702a01fb45b612.zip |
log: Disable stack trace from command line
Add a '--nobacktrace' command line switch to let the system
handle stack traces. The default is to let ConnMan handle them
as before
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -292,7 +292,7 @@ void __connman_log_enable(struct connman_debug_desc *start, } int __connman_log_init(const char *program, const char *debug, - connman_bool_t detach) + connman_bool_t detach, connman_bool_t backtrace) { static char path[PATH_MAX]; int option = LOG_NDELAY | LOG_PID; @@ -308,7 +308,8 @@ int __connman_log_init(const char *program, const char *debug, if (detach == FALSE) option |= LOG_PERROR; - signal_setup(signal_handler); + if (backtrace == TRUE) + signal_setup(signal_handler); openlog(basename(program), option, LOG_DAEMON); @@ -317,13 +318,14 @@ int __connman_log_init(const char *program, const char *debug, return 0; } -void __connman_log_cleanup(void) +void __connman_log_cleanup(connman_bool_t backtrace) { syslog(LOG_INFO, "Exit"); closelog(); - signal_setup(SIG_DFL); + if (backtrace == TRUE) + signal_setup(SIG_DFL); g_strfreev(enabled); } |