From 93348ca1ca438bd6cbcabf3046b5f1da43e967a8 Mon Sep 17 00:00:00 2001 From: fangpeina Date: Thu, 13 Jun 2024 22:03:47 +0800 Subject: [PATCH] system/uorb: fix err when using the -n 1 parameter Signed-off-by: fangpeina --- system/uorb/listener.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/system/uorb/listener.c b/system/uorb/listener.c index 5d416e627..4bbb1dbc4 100644 --- a/system/uorb/listener.c +++ b/system/uorb/listener.c @@ -535,12 +535,7 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects, fds[i].events = POLLIN; } - if (nb_msgs == 1) - { - listener_print(tmp->object.meta, fd); - orb_unsubscribe(fd); - } - else if (interval != 0) + if (interval != 0) { orb_set_interval(fd, (unsigned)interval); @@ -553,13 +548,6 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects, i++; } - if (nb_msgs == 1) - { - free(fds); - free(recv_msgs); - return; - } - /* Loop poll and print recieved messages */ while ((!nb_msgs || nb_recv_msgs < nb_msgs) && !g_should_exit)