From 88e871b13ee22dea95e8bce5dde1ae0cd4182dcf Mon Sep 17 00:00:00 2001 From: fangzhenwei Date: Thu, 25 Nov 2021 13:32:52 +0800 Subject: [PATCH] nuttx/pty: pty FIONBIO return -ENOTTY when pipe_ioctl return OK Signed-off-by: fangzhenwei --- drivers/serial/pty.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index 497b95225a..5a3bb849ba 100644 --- a/drivers/serial/pty.c +++ b/drivers/serial/pty.c @@ -881,6 +881,13 @@ static int pty_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { ret = file_ioctl(&dev->pd_sink, cmd, arg); } + + /* Let the default handler set O_NONBLOCK flags for us. */ + + if (ret >= 0) + { + ret = -ENOTTY; + } } break;