Browse Source

HAL_SITL: fixed build error

master
Andrew Tridgell 6 years ago
parent
commit
0873e54cc0
  1. 8
      libraries/AP_HAL_SITL/HAL_SITL_Class.cpp

8
libraries/AP_HAL_SITL/HAL_SITL_Class.cpp

@ -80,13 +80,17 @@ static char *new_argv[100]; @@ -80,13 +80,17 @@ static char *new_argv[100];
/*
save watchdog data
*/
static void watchdog_save(const uint32_t *data, uint32_t nwords)
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) {
::write(fd, data, nwords*4);
if (::write(fd, data, nwords*4) == nwords*4) {
ret = true;
}
::close(fd);
}
return ret;
}
/*

Loading…
Cancel
Save