Skip to content

Commit

Permalink
Merge pull request #695 from averater/close_files_after_write
Browse files Browse the repository at this point in the history
Close file after write
  • Loading branch information
lti9hc authored Nov 20, 2024
2 parents 122170b + b1603a1 commit cfe2cc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/offlinelogstorage/dlt_offline_logstorage_behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ DLT_STATIC int dlt_logstorage_sync_to_file(DltLogStorageFilterConfig *config,
}

if (config->skip == 1) {
dlt_logstorage_close_file(config);
return 0;
}

Expand Down Expand Up @@ -1004,11 +1005,13 @@ DLT_STATIC int dlt_logstorage_sync_to_file(DltLogStorageFilterConfig *config,
count, true, false) != 0)
{
dlt_vlog(LOG_ERR, "%s: failed to open log file\n", __func__);
dlt_logstorage_close_file(config);
return -1;
}

if (config->skip == 1)
{
dlt_logstorage_close_file(config);
return 0;
}
}
Expand All @@ -1021,7 +1024,7 @@ DLT_STATIC int dlt_logstorage_sync_to_file(DltLogStorageFilterConfig *config,
}

footer->wrap_around_cnt = 0;

dlt_logstorage_close_file(config);
return 0;
}

Expand Down

0 comments on commit cfe2cc4

Please sign in to comment.