mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_HAL_Linux: keep "dfd" open util fsync is done.
Since we want to do a fsync on "dfd", it can not be closed before that. Signed-off-by: junan <junan76@163.com>
This commit is contained in:
parent
1e8e250459
commit
4ee5b0ea12
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user