Skip to content

Commit

Permalink
AP_HAL_Linux: keep "dfd" open util fsync is done.
Browse files Browse the repository at this point in the history
Since we want to do a fsync on "dfd", it can not be closed before that.

Signed-off-by: junan <[email protected]>
  • Loading branch information
junan76 authored and peterbarker committed Sep 8, 2024
1 parent 1e8e250 commit 4ee5b0e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions libraries/AP_HAL_Linux/Storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ int Storage::_storage_create(const char *dpath)
unlinkat(dfd, dpath, 0);
int fd = openat(dfd, STORAGE_FILE, O_RDWR|O_CREAT|O_CLOEXEC, 0666);

close(dfd);

if (fd == -1) {
fprintf(stderr, "Failed to create storage file %s/%s\n", dpath,
STORAGE_FILE);
Expand Down

0 comments on commit 4ee5b0e

Please sign in to comment.