Browse Source

AP_HAL_SITL: check return value from posix_memalign

Avoids return-value-must-be-checked compiler warning
mission-4.1.18
Peter Barker 7 years ago committed by Andrew Tridgell
parent
commit
d6fe9d47e0
  1. 4
      libraries/AP_HAL_SITL/Scheduler.cpp

4
libraries/AP_HAL_SITL/Scheduler.cpp

@ -267,7 +267,9 @@ bool Scheduler::thread_create(AP_HAL::MemberProc proc, const char *name, uint32_ @@ -267,7 +267,9 @@ bool Scheduler::thread_create(AP_HAL::MemberProc proc, const char *name, uint32_
if (!a->f) {
goto failed;
}
posix_memalign(&a->stack, 4096, alloc_stack);
if (posix_memalign(&a->stack, 4096, alloc_stack) != 0) {
goto failed;
}
if (!a->stack) {
goto failed;
}

Loading…
Cancel
Save