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 20:03:19 UTC

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

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