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

[incubator-nuttx] 01/05: nuttx/pty:pty FIONBIO pass to pipe control

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 1afdb06981b7a1e3bf51beca8e272de5694a7885
Author: fangzhenwei <fa...@xiaomi.com>
AuthorDate: Fri Nov 5 14:46:39 2021 +0800

    nuttx/pty:pty FIONBIO pass to pipe control
    
    1. pass FIONBIO ioctl to pipe
    2. resolve the return value error
    
    Signed-off-by: fangzhenwei <fa...@xiaomi.com>
---
 drivers/serial/pty.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c
index e8b5a22..78cfafe 100644
--- a/drivers/serial/pty.c
+++ b/drivers/serial/pty.c
@@ -874,6 +874,12 @@ static int pty_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
         }
         break;
 
+      case FIONBIO:
+        {
+          ret = file_ioctl(&dev->pd_sink, cmd, arg);
+        }
+        break;
+
       /* Any unrecognized IOCTL commands will be passed to the contained
        * pipe driver.
        *
@@ -892,7 +898,7 @@ static int pty_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
               ret = file_ioctl(&dev->pd_sink, cmd, arg);
             }
 #else
-          ret = ENOTTY;
+          ret = -ENOTTY;
 #endif
         }
         break;