summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/utilities/ulog/backend/file_be.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/utilities/ulog/backend/file_be.c b/components/utilities/ulog/backend/file_be.c
index 693d9abaeb..62f3f7ad83 100644
--- a/components/utilities/ulog/backend/file_be.c
+++ b/components/utilities/ulog/backend/file_be.c
@@ -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 */