summaryrefslogtreecommitdiffstats
path: root/firmware/logf.c
diff options
context:
space:
mode:
authorMihail Zenkov <mihail.zenkov@gmail.com>2016-03-31 11:33:11 +0000
committerGerrit Rockbox <gerrit@rockbox.org>2016-04-04 11:07:44 +0200
commite599810ffaa6412326f61d026fc598c721b3a01c (patch)
treefe21a4f5f388ed87e3112f00ff68cf3448f34e4e /firmware/logf.c
parent26beb30c155aebc5e6e50366f1cfa34300a8c63a (diff)
downloadrockbox-e599810ffaa6412326f61d026fc598c721b3a01c.tar.gz
rockbox-e599810ffaa6412326f61d026fc598c721b3a01c.tar.bz2
rockbox-e599810ffaa6412326f61d026fc598c721b3a01c.zip
Don't add new message to logf when we dump it to file
Fix log file corruption if we have new messages at dumping log to file. Comment removed as it incorrect. We store all messages in direct order (last message at end of file). Change-Id: I4acfa8a0935cc41a889e08f6bc42974fefd1ade2
Diffstat (limited to 'firmware/logf.c')
-rw-r--r--firmware/logf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/logf.c b/firmware/logf.c
index 0f05c6590d..bdc5ad9cc0 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -62,6 +62,7 @@ static int logdiskfindex;
unsigned char logfbuffer[MAX_LOGF_SIZE];
int logfindex;
bool logfwrap;
+bool logfenabled = true;
#endif
#ifdef HAVE_REMOTE_LCD
@@ -214,6 +215,9 @@ static int logf_push(void *userp, unsigned char c)
void _logf(const char *fmt, ...)
{
+ if (!logfenabled)
+ return;
+
#ifdef USB_ENABLE_SERIAL
int old_logfindex = logfindex;
#endif