You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/12 19:49:33 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #4130: sys/poll: add POLLRDHUP definition

xiaoxiang781216 opened a new pull request #4130:
URL: https://github.com/apache/incubator-nuttx/pull/4130


   ## Summary
   
   ## Impact
   New flag
   
   ## Testing
   
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4130: sys/poll: add POLLRDHUP definition

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4130:
URL: https://github.com/apache/incubator-nuttx/pull/4130


   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4130: sys/poll: add POLLRDHUP definition

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4130:
URL: https://github.com/apache/incubator-nuttx/pull/4130#discussion_r667920852



##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       since shutdown isn't implemented in NuttX yet:
   https://github.com/apache/incubator-nuttx/blob/master/libs/libc/net/lib_shutdown.c
   from this discussion, it's a right defintion, otherwise the poller will lose the notification: 
   https://stackoverflow.com/questions/56177060/pollhup-vs-pollrdhup

##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       This style follow POLLRDNORM/POLLRDBAND and POLLWRNORM/POLLWRBAND, so I will keep 0x10 but add a comment.

##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       Done.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4130: sys/poll: add POLLRDHUP definition

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4130:
URL: https://github.com/apache/incubator-nuttx/pull/4130#discussion_r667916835



##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       `POLLRDHUP` and `POLLHUP` exist for different reasons, so it is not right for them to be defined to the same value.

##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       Then I'd suggest to explicitly define it to POLLHUP value and explain the reason for this (shutdown not implemented).
   ```suggestion
   #define POLLRDHUP    POLLHUP
   ```
   It is very easy to overlook that **0x10** value without noticing that it contains the same value as `POLLHUP`.

##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       Then I'd suggest to explicitly define it to POLLHUP value and explain the reason for this (shutdown not implemented).
   ```suggestion
   #define POLLRDHUP    POLLHUP  /* (Reason for it) */
   ```
   It is very easy to overlook that **0x10** value without noticing that it contains the same value as `POLLHUP`.

##########
File path: include/sys/poll.h
##########
@@ -74,6 +74,7 @@
 
 #define POLLERR      (0x08)
 #define POLLHUP      (0x10)
+#define POLLRDHUP    (0x10)

Review comment:
       Ok, at least leave them in a separate group, the same as those you mentioned.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org