diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c index 77f8bc223..02073a8ea 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage.c +++ b/src/offlinelogstorage/dlt_offline_logstorage.c @@ -1760,6 +1760,7 @@ DLT_STATIC int dlt_daemon_offline_setup_filter_properties(DltLogStorage *handle, tmp_data.log_level = DLT_LOG_VERBOSE; tmp_data.reset_log_level = DLT_LOG_OFF; tmp_data.disable_network_routing = DLT_LOGSTORAGE_DISABLE_NW_OFF; + tmp_data.fd = -1; for (i = 0; i < DLT_LOGSTORAGE_FILTER_CONF_COUNT; i++) { ret = dlt_logstorage_get_filter_value(config_file, sec_name, i, value); diff --git a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c index e705c3ef2..9b346983b 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c +++ b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c @@ -614,7 +614,8 @@ int dlt_logstorage_open_log_file(DltLogStorageFilterConfig *config, * is_sync is true and (other than ON_MSG sync behavior and current size is less than configured size) or * msg_size fit into the size (ON_MSG or par of cache needs to be written into new file), open it */ if ((ret == 0) && - ((is_sync && (s.st_size < (int)config->file_size)) || + ((config->fd == -1) || + (is_sync && (s.st_size < (int)config->file_size)) || (!is_sync && (s.st_size + msg_size <= (int)config->file_size)))) { dlt_logstorage_open_log_output_file(config, absolute_file_path, "a"); config->current_write_file_offset = s.st_size;