You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/02/22 05:42:56 UTC
[incubator-nuttx] 02/05: nuttx/pty: pass read nonblock flag to pipe
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit c7c91488d15161ec5b6114b322cd050e403ad298
Author: fangzhenwei <fa...@xiaomi.com>
AuthorDate: Tue Nov 9 15:24:41 2021 +0800
nuttx/pty: pass read nonblock flag to pipe
Signed-off-by: fangzhenwei <fa...@xiaomi.com>
---
drivers/serial/pty.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c
index 78cfafe..497b952 100644
--- a/drivers/serial/pty.c
+++ b/drivers/serial/pty.c
@@ -876,7 +876,11 @@ static int pty_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case FIONBIO:
{
- ret = file_ioctl(&dev->pd_sink, cmd, arg);
+ ret = file_ioctl(&dev->pd_src, cmd, arg);
+ if (ret >= 0 || ret == -ENOTTY)
+ {
+ ret = file_ioctl(&dev->pd_sink, cmd, arg);
+ }
}
break;