You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2024/03/10 14:44:42 UTC

(nuttx) 02/03: net/local: Skip poll_notify in local_event_pollsetup if no event happen

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b0e3a35c39a05f921b9de8cba269b3d4e4fa4cba
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Feb 28 13:20:02 2024 +0800

    net/local: Skip poll_notify in local_event_pollsetup if no event happen
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 net/local/local_netpoll.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/local/local_netpoll.c b/net/local/local_netpoll.c
index f24f2bc307..60974d49e8 100644
--- a/net/local/local_netpoll.c
+++ b/net/local/local_netpoll.c
@@ -46,7 +46,6 @@ static int local_event_pollsetup(FAR struct local_conn_s *conn,
                                  FAR struct pollfd *fds,
                                  bool setup)
 {
-  pollevent_t eventset;
   int i;
 
   if (setup)
@@ -79,14 +78,11 @@ static int local_event_pollsetup(FAR struct local_conn_s *conn,
           return -EBUSY;
         }
 
-      eventset = 0;
       if (conn->lc_state == LOCAL_STATE_LISTENING &&
           dq_peek(&conn->u.server.lc_waiters) != NULL)
         {
-          eventset |= POLLIN;
+          poll_notify(&fds, 1, POLLIN);
         }
-
-      poll_notify(&fds, 1, eventset);
     }
   else
     {