syslog_rpmsg: update check method when do flush()

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-07-27 15:43:20 +08:00 committed by Xiang Xiao
parent e56c8571dc
commit 45c04e9125
1 changed files with 2 additions and 1 deletions

View File

@ -347,7 +347,8 @@ int syslog_rpmsg_flush(FAR struct syslog_channel_s *channel)
flags = enter_critical_section();
if (priv->head - priv->flush > priv->size)
if (priv->head > priv->flush &&
priv->head - priv->flush > priv->size)
{
priv->flush = priv->tail;
}