AP_HAL_SITL: check return value from posix_memalign

Avoids return-value-must-be-checked compiler warning
This commit is contained in:
Peter Barker 2018-08-27 12:09:29 +10:00 committed by Andrew Tridgell
parent f06b27e4a3
commit d6fe9d47e0
1 changed files with 3 additions and 1 deletions

View File

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