From 0d0a55684799f5b6c448eb21b5a64f1dd4466a79 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 1 Jan 2019 16:23:46 +0100 Subject: [PATCH] Fix usage of errno in POSIX semaphore error handling Previous commit 98ae0186e93 changed the err variable to errno, which is not the return value we are looking for. --- platforms/posix/src/px4_layer/px4_sem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/posix/src/px4_layer/px4_sem.cpp b/platforms/posix/src/px4_layer/px4_sem.cpp index 355d409feb..c5d9e241ed 100644 --- a/platforms/posix/src/px4_layer/px4_sem.cpp +++ b/platforms/posix/src/px4_layer/px4_sem.cpp @@ -142,7 +142,7 @@ int px4_sem_timedwait(px4_sem_t *s, const struct timespec *abstime) int err = ret; - if (err != 0 && errno != ETIMEDOUT) { + if (err != 0 && err != ETIMEDOUT) { setbuf(stdout, nullptr); setbuf(stderr, nullptr); const unsigned NAMELEN = 32;