mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-03 23:10:46 +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:
1 parent
884621415d
commit
2296c9acfa
1 file changed
+1
-1
@@ -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