summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-26 16:01:36 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-28 09:39:41 +0300
commitbf265f7494edf4d831d52f0333702a01fb45b612 (patch)
tree8f222ddaa42357b65ca150837eccf0790222f02d /src/log.c
parentfc6c9684cc5a63c3d03aed3df201e89b4257f368 (diff)
downloadconnman-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/log.c b/src/log.c
index 7d1896c4..9a68a4b9 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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);
}