mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 04:23:34 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user