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:58 UTC

[incubator-nuttx] 04/05: nuttx/pty: pty FIONBIO return -ENOTTY when pipe_ioctl return OK

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 88e871b13ee22dea95e8bce5dde1ae0cd4182dcf
Author: fangzhenwei <fa...@xiaomi.com>
AuthorDate: Thu Nov 25 13:32:52 2021 +0800

    nuttx/pty: pty FIONBIO return -ENOTTY when pipe_ioctl return OK
    
    Signed-off-by: fangzhenwei <fa...@xiaomi.com>
---
 drivers/serial/pty.c | 7 +++++++
 1 file changed, 7 insertions(+)

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