diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index 497b95225a6..5a3bb849ba1 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;