From 131e4dc69d301c2f1651efdfe581ae5e799a5dda Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Tue, 28 Jun 2022 15:53:43 +0800 Subject: [PATCH] system/uorb: simply orb_check by SNIOC_UPDATED Signed-off-by: Jiuzhu Dong --- system/uorb/uORB/uORB.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c index 953e3b26e..5ab3b2ca3 100644 --- a/system/uorb/uORB/uORB.c +++ b/system/uorb/uORB/uORB.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -228,20 +227,7 @@ int orb_get_state(int fd, FAR struct orb_state *state) int orb_check(int fd, FAR bool *updated) { - struct pollfd fds[1]; - int ret; - - fds[0].fd = fd; - fds[0].events = POLLIN; - - ret = poll(fds, 1, 0); - if (ret < 0) - { - return -1; - } - - *updated = (fds[0].revents & POLLIN) > 0; - return 0; + return ioctl(fd, SNIOC_UPDATED, (unsigned long)(uintptr_t)updated); } int orb_ioctl(int fd, int cmd, unsigned long arg)