4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 07:03:32 +08:00

[ulog] Optimize unnecessary refresh

This commit is contained in:
tyx 2022-05-24 16:24:45 +08:00 committed by guo
parent 9ebe0f3b47
commit 4f342456b3

View File

@ -79,11 +79,10 @@ static void ulog_file_backend_flush_with_buf(struct ulog_backend *backend)
struct ulog_file_be *be = (struct ulog_file_be *) backend;
rt_size_t file_size = 0, write_size = 0;
if (be->enable == RT_FALSE)
if (be->enable == RT_FALSE || be->buf_ptr_now == be->file_buf)
{
return;
}
if (be->cur_log_file_fd < 0)
{
/* check log file directory */