You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/05 03:58:08 UTC

[incubator-nuttx-apps] branch master updated: poll: Don't need monitor POLLERR or POLLHUP explicitly

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

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new a86790c36 poll: Don't need monitor POLLERR or POLLHUP explicitly
a86790c36 is described below

commit a86790c3678ddbb94632b4bcbd128fb7c3177552
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Oct 4 02:28:15 2022 +0800

    poll: Don't need monitor POLLERR or POLLHUP explicitly
    
    since spec require the implementation always report POLLERR/POLLHUP:
    https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/tcpblaster/tcpblaster_client.c       | 2 +-
 examples/tcpblaster/tcpblaster_server.c       | 4 ++--
 examples/udpblaster/udpblaster_target.c       | 2 +-
 graphics/twm4nx/src/cinput.cxx                | 4 ++--
 netutils/usrsock_rpmsg/usrsock_rpmsg_server.c | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/examples/tcpblaster/tcpblaster_client.c b/examples/tcpblaster/tcpblaster_client.c
index 540a9644a..9411f53ab 100644
--- a/examples/tcpblaster/tcpblaster_client.c
+++ b/examples/tcpblaster/tcpblaster_client.c
@@ -148,7 +148,7 @@ void tcpblaster_client(void)
 
       memset(fds, 0, 1 * sizeof(struct pollfd));
       fds[0].fd     = sockfd;
-      fds[0].events = POLLOUT | POLLHUP;
+      fds[0].events = POLLOUT;
 
       /* Wait until we can send data or until the connection is lost */
 
diff --git a/examples/tcpblaster/tcpblaster_server.c b/examples/tcpblaster/tcpblaster_server.c
index ce12f7deb..ea7311d2a 100644
--- a/examples/tcpblaster/tcpblaster_server.c
+++ b/examples/tcpblaster/tcpblaster_server.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/examples/tcpblaster/tcpblaster-server.c
+ * apps/examples/tcpblaster/tcpblaster_server.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -191,7 +191,7 @@ void tcpblaster_server(void)
 
       memset(fds, 0, 1 * sizeof(struct pollfd));
       fds[0].fd     = acceptsd;
-      fds[0].events = POLLIN | POLLHUP;
+      fds[0].events = POLLIN;
 
       /* Wait until we can receive data or until the connection is lost */
 
diff --git a/examples/udpblaster/udpblaster_target.c b/examples/udpblaster/udpblaster_target.c
index 6611c815a..01f603c51 100644
--- a/examples/udpblaster/udpblaster_target.c
+++ b/examples/udpblaster/udpblaster_target.c
@@ -290,7 +290,7 @@ int main(int argc, FAR char *argv[])
 
       memset(fds, 0, 1 * sizeof(struct pollfd));
       fds[0].fd     = sockfd;
-      fds[0].events = POLLOUT | POLLHUP;
+      fds[0].events = POLLOUT;
 
       /* Wait until we can send data or until the connection is lost */
 
diff --git a/graphics/twm4nx/src/cinput.cxx b/graphics/twm4nx/src/cinput.cxx
index ebe290a1f..11dfb334f 100644
--- a/graphics/twm4nx/src/cinput.cxx
+++ b/graphics/twm4nx/src/cinput.cxx
@@ -785,12 +785,12 @@ int CInput::session(void)
       struct pollfd pfd[NINPUT_DEVICES];
 #ifndef CONFIG_TWM4NX_NOKEYBOARD
       pfd[KBD_INDEX].fd        = m_kbdFd;
-      pfd[KBD_INDEX].events    = POLLIN | POLLERR | POLLHUP;
+      pfd[KBD_INDEX].events    = POLLIN;
       pfd[KBD_INDEX].revents   = 0;
 #endif
 #ifndef CONFIG_TWM4NX_NOMOUSE
       pfd[MOUSE_INDEX].fd      = m_mouseFd;
-      pfd[MOUSE_INDEX].events  = POLLIN | POLLERR | POLLHUP;
+      pfd[MOUSE_INDEX].events  = POLLIN;
       pfd[MOUSE_INDEX].revents = 0;
 #endif
 
diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
index 0cb96590f..4298a2100 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
@@ -942,7 +942,7 @@ static int usrsock_rpmsg_prepare_poll(struct usrsock_rpmsg_s *priv,
       if (priv->pfds[i].ptr)
         {
           pfds[count] = priv->pfds[i];
-          pfds[count++].events |= POLLERR | POLLHUP | POLLSOCK;
+          pfds[count++].events |= POLLSOCK;
         }
     }