posix: remove appalling errno hack

This commit is contained in:
Julian Oes 2018-11-14 14:48:38 +01:00
parent 66e7b4d578
commit 876d4ebd76

View File

@ -389,21 +389,10 @@ extern "C" {
nsecs -= (nsecs / billion) * billion;
ts.tv_nsec = nsecs;
// Execute a blocking wait for that time in the future
errno = 0;
ret = px4_sem_timedwait(&sem, &ts);
#ifndef __PX4_DARWIN
ret = errno;
#endif
// Ensure ret is negative on failure
if (ret > 0) {
ret = -ret;
}
if (ret && ret != -ETIMEDOUT) {
PX4_WARN("%s: px4_poll() sem error", thread_name);
if (ret && errno != ETIMEDOUT) {
PX4_WARN("%s: px4_poll() sem error: %s", thread_name, strerror(errno));
}
} else if (timeout < 0) {