xiaoxiang781216 commented on code in PR #11857:
URL: https://github.com/apache/nuttx/pull/11857#discussion_r1517079507
##########
drivers/pipes/pipe.c:
##########
@@ -305,9 +303,9 @@ int pipe2(int fd[2], int flags)
/* Clear O_NONBLOCK if it was set previously */
- if ((flags & O_NONBLOCK) == 0)
+ if (!nonblock)
{
- ret = fcntl(fd[1], F_SETFL, flags & (~O_NONBLOCK));
+ ret = ioctl(fd[1], FIONBIO, &nonblock);
Review Comment:
both places use `nonblock`, the only difference is that `nonblock` has
different type:
1. nonblock in pipe.c is local variable, so it's fine to change it's type to
int to match FIONBIO's expectation
2. nonblock in local_fifo.c is function argument, so it is better to keep
bool type
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]