From 1afdb06981b7a1e3bf51beca8e272de5694a7885 Mon Sep 17 00:00:00 2001 From: fangzhenwei Date: Fri, 5 Nov 2021 14:46:39 +0800 Subject: [PATCH] nuttx/pty:pty FIONBIO pass to pipe control 1. pass FIONBIO ioctl to pipe 2. resolve the return value error Signed-off-by: fangzhenwei --- 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 e8b5a2207b..78cfafeee6 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;