From da7c556f77e1a749d7c1c9773fa3d47a8e7765e2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Dec 2023 19:04:45 +1100 Subject: [PATCH] AP_InertialSensor: avoid fcntl.h allows mixing of lwip and sockets --- libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp index 49a691b606..583ad75a42 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp @@ -2,7 +2,7 @@ #include "AP_InertialSensor_SITL.h" #include #include -#include +#include #if AP_SIM_INS_ENABLED @@ -410,7 +410,7 @@ void AP_InertialSensor_SITL::read_gyro_from_file() if (gyro_fd == -1) { char namebuf[32]; snprintf(namebuf, 32, "/tmp/gyro%d.dat", gyro_instance); - gyro_fd = open(namebuf, O_RDONLY|O_CLOEXEC); + gyro_fd = AP::FS().open(namebuf, O_RDONLY); if (gyro_fd == -1) { AP_HAL::panic("gyro data file %s not found", namebuf); }