casaroli commented on code in PR #13686:
URL: https://github.com/apache/nuttx/pull/13686#discussion_r4434904399
##########
drivers/syslog/ramlog.c:
##########
@@ -290,10 +274,16 @@ static ssize_t ramlog_addbuf(FAR struct ramlog_dev_s
*priv,
flags = enter_critical_section();
#ifdef CONFIG_RAMLOG_SYSLOG
- if (header->rl_magic != RAMLOG_MAGIC_NUMBER && priv == &g_sysdev)
+ if (priv == &g_sysdev && header == NULL)
{
+ priv->rl_header = (FAR void *)g_sysbuffer;
Review Comment:
`g_sysdev` is zeroed at every boot, so `header == NULL` is true after a warm
reset too. With `RAMLOG_BUFFER_SECTION` the memset then clears the log that the
section is there to keep. Please keep a marker in the buffer (the magic)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]