uavcan_virtual_can_driver: fix invalid use of px4_sem_getvalue

sem_getvalue returns 0 on success, -1 on error, and never a value > 0.
This commit is contained in:
Beat Küng
2019-10-16 18:29:26 +02:00
committed by Julian Oes
parent 884621415d
commit 2296c9acfa
@@ -402,7 +402,7 @@ class VirtualCanDriver : public uavcan::ICanDriver,
int count;
int rv = px4_sem_getvalue(&sem, &count);
if (rv > 0 && count <= 0) {
if (rv == 0 && count <= 0) {
px4_sem_post(&sem);
}
}