mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 10:03:34 +08:00
posix: remove appalling errno hack
This commit is contained in:
@@ -389,21 +389,10 @@ extern "C" {
|
|||||||
nsecs -= (nsecs / billion) * billion;
|
nsecs -= (nsecs / billion) * billion;
|
||||||
ts.tv_nsec = nsecs;
|
ts.tv_nsec = nsecs;
|
||||||
|
|
||||||
// Execute a blocking wait for that time in the future
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
ret = px4_sem_timedwait(&sem, &ts);
|
ret = px4_sem_timedwait(&sem, &ts);
|
||||||
#ifndef __PX4_DARWIN
|
|
||||||
ret = errno;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Ensure ret is negative on failure
|
if (ret && errno != ETIMEDOUT) {
|
||||||
if (ret > 0) {
|
PX4_WARN("%s: px4_poll() sem error: %s", thread_name, strerror(errno));
|
||||||
ret = -ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret && ret != -ETIMEDOUT) {
|
|
||||||
PX4_WARN("%s: px4_poll() sem error", thread_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (timeout < 0) {
|
} else if (timeout < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user