From f8bcdf9d3ac2c56436d0199715455a57aeb7c73a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 12 May 2019 09:10:31 +1000 Subject: [PATCH] HAL_SITL: fixed cygwin build error --- libraries/AP_HAL_SITL/HAL_SITL_Class.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp index 63ca451f00..21c03ab888 100644 --- a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp +++ b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp @@ -85,7 +85,7 @@ static bool watchdog_save(const uint32_t *data, uint32_t nwords) int fd = ::open("persistent.dat", O_WRONLY|O_CREAT|O_TRUNC, 0644); bool ret = false; if (fd != -1) { - if (::write(fd, data, nwords*4) == nwords*4) { + if (::write(fd, data, nwords*4) == (ssize_t)(nwords*4)) { ret = true; } ::close(fd); @@ -101,7 +101,7 @@ static bool watchdog_load(uint32_t *data, uint32_t nwords) int fd = ::open("persistent.dat", O_RDONLY, 0644); bool ret = false; if (fd != -1) { - ret = (::read(fd, data, nwords*4) == nwords*4); + ret = (::read(fd, data, nwords*4) == (ssize_t)(nwords*4)); ::close(fd); } return ret;