diff options
| author | tyx <[email protected]> | 2022-05-24 16:24:45 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-05-25 10:05:41 +0800 |
| commit | 4f342456b3f6a672a860bc8a9e604628e5fbc74e (patch) | |
| tree | ac5c637e964007cb88ccf4a2700ec848efe841ea /components/utilities | |
| parent | 9ebe0f3b47de8129e44020bf73c7f69294b61b64 (diff) | |
[ulog] Optimize unnecessary refresh
Diffstat (limited to 'components/utilities')
| -rw-r--r-- | components/utilities/ulog/backend/file_be.c | 3 |
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 */ |
