syslog_rpmsg: handle syslog_rpmsg_transfer() return value

in case of only update head

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2024-02-06 11:49:16 +08:00 committed by Xiang Xiao
parent 768e533123
commit 661d382322
1 changed files with 5 additions and 2 deletions

View File

@ -189,11 +189,14 @@ static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
{ {
if (priv->head + 1 - priv->tail >= priv->size) if (priv->head + 1 - priv->tail >= priv->size)
{ {
bool ret = false;
if (!priv->flush && !up_interrupt_context() && !sched_idletask()) if (!priv->flush && !up_interrupt_context() && !sched_idletask())
{ {
syslog_rpmsg_transfer(priv, true); ret = syslog_rpmsg_transfer(priv, true);
} }
else
if (!ret)
{ {
/* Overwrite */ /* Overwrite */