Skip to content

Commit

Permalink
system/uorb: fix err when using the -n 1 parameter
Browse files Browse the repository at this point in the history
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
  • Loading branch information
fangpeina authored and xiaoxiang781216 committed Aug 27, 2024
1 parent fd40e25 commit 93348ca
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions system/uorb/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand Down

0 comments on commit 93348ca

Please sign in to comment.