acassis commented on code in PR #3368:
URL: https://github.com/apache/nuttx-apps/pull/3368#discussion_r2716435599
##########
system/uorb/listener.c:
##########
@@ -530,6 +532,194 @@ static int listener_print(FAR const struct orb_metadata
*meta, int fd)
return ret;
}
+/****************************************************************************
+ * Name: listener_flush_topic
+ *
+ * Description:
+ * Flush sensor device.
+ *
+ * Input Parameters:
+ * objlist Topic object list.
+ * nb_objects Length of objects list.
+ * timeout Maximum poll waiting time(microsecond).
+ *
+ * Returned Value:
+ * void
+ ****************************************************************************/
+
+static void listener_flush_topic(FAR const struct listen_list_s *objlist,
+ int nb_objects, int timeout)
+{
+ FAR struct listen_object_s *tmp;
+ FAR struct pollfd *fds;
+ unsigned int events;
+ FAR int8_t *result;
+ int nb_flush = 0;
+ int i = 0;
+ int ret;
+
+ fds = calloc(nb_objects, sizeof(struct pollfd));
+ if (!fds)
Review Comment:
```suggestion
if (fds == NULL)
##########
system/uorb/listener.c:
##########
@@ -530,6 +532,194 @@ static int listener_print(FAR const struct orb_metadata
*meta, int fd)
return ret;
}
+/****************************************************************************
+ * Name: listener_flush_topic
+ *
+ * Description:
+ * Flush sensor device.
+ *
+ * Input Parameters:
+ * objlist Topic object list.
+ * nb_objects Length of objects list.
+ * timeout Maximum poll waiting time(microsecond).
+ *
+ * Returned Value:
+ * void
+ ****************************************************************************/
+
+static void listener_flush_topic(FAR const struct listen_list_s *objlist,
+ int nb_objects, int timeout)
+{
+ FAR struct listen_object_s *tmp;
+ FAR struct pollfd *fds;
+ unsigned int events;
+ FAR int8_t *result;
+ int nb_flush = 0;
+ int i = 0;
+ int ret;
+
+ fds = calloc(nb_objects, sizeof(struct pollfd));
+ if (!fds)
+ {
+ return;
+ }
+
+ result = calloc(nb_objects, sizeof(int8_t));
+ if (!result)
Review Comment:
```suggestion
if (result == NULL)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]