From c7c91488d15161ec5b6114b322cd050e403ad298 Mon Sep 17 00:00:00 2001 From: fangzhenwei Date: Tue, 9 Nov 2021 15:24:41 +0800 Subject: [PATCH] nuttx/pty: pass read nonblock flag to pipe Signed-off-by: fangzhenwei --- 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 78cfafeee6..497b95225a 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;