This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 2956632f435d2275c3ddfb262268daea76376fef
Author: Bowen Wang <[email protected]>
AuthorDate: Tue May 26 22:36:11 2026 +0800

    drivers/syslog/syslog_rpmsg: keep the log when the buffer overflows
    
    On overflow syslog_rpmsg_addbuf() set tail = head, which marks the
    buffer empty and loses everything just written. Set tail to the byte
    after head so the newest size - 1 bytes are kept.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/syslog/syslog_rpmsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index 546ec12804b..3f780c268b2 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -274,7 +274,7 @@ static void syslog_rpmsg_addbuf(FAR struct syslog_rpmsg_s 
*priv,
   header->head = (header->head + len) % header->size;
   if (overwritten)
     {
-      header->tail = header->head;
+      header->tail = (header->head + 1) % header->size;
     }
 
   if (!priv->suspend && is_rpmsg_ept_ready(&priv->ept))

Reply via email to