mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
ramlog:flush should reset the tail of the reader
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
This commit is contained in:
parent
c055fc2f85
commit
b29d103ad3
1 changed files with 16 additions and 1 deletions
|
@ -234,6 +234,21 @@ static void ramlog_pollnotify(FAR struct ramlog_dev_s *priv)
|
|||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ramlog_flush
|
||||
****************************************************************************/
|
||||
|
||||
static void ramlog_bufferflush(FAR struct ramlog_dev_s *priv)
|
||||
{
|
||||
FAR struct ramlog_user_s *upriv;
|
||||
|
||||
priv->rl_header->rl_head = 0;
|
||||
list_for_every_entry(&priv->rl_list, upriv, struct ramlog_user_s, rl_node)
|
||||
{
|
||||
upriv->rl_tail = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ramlog_copybuf
|
||||
****************************************************************************/
|
||||
|
@ -535,7 +550,7 @@ static int ramlog_file_ioctl(FAR struct file *filep, int cmd,
|
|||
upriv->rl_threashold = (uint32_t)arg;
|
||||
break;
|
||||
case BIOC_FLUSH:
|
||||
priv->rl_header->rl_head = 0;
|
||||
ramlog_bufferflush(priv);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
|
|
Loading…
Reference in a new issue