From 61066ecbc8c5f150bb905dc64aef473fe6c921c2 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 5 Feb 2022 02:35:04 +0800 Subject: [PATCH] serial/pty: Sync the default termios setting regardless CONFIG_SERIAL_TERMIOS Signed-off-by: Xiang Xiao --- drivers/serial/pty.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index 6d1bd5bfc4..6e4e0d81e4 100644 --- a/drivers/serial/pty.c +++ b/drivers/serial/pty.c @@ -120,14 +120,10 @@ struct pty_dev_s struct file pd_src; /* Provides data to read() method (pipe output) */ struct file pd_sink; /* Accepts data from write() method (pipe input) */ bool pd_master; /* True: this is the master */ - #ifdef CONFIG_SERIAL_TERMIOS - /* Terminal control flags */ - - tcflag_t pd_iflag; /* Terminal nput modes */ - tcflag_t pd_oflag; /* Terminal output modes */ + tcflag_t pd_iflag; /* Terminal input modes */ #endif - + tcflag_t pd_oflag; /* Terminal output modes */ struct pty_poll_s pd_poll[CONFIG_DEV_PTY_NPOLLWAITERS]; }; @@ -608,18 +604,15 @@ static ssize_t pty_write(FAR struct file *filep, FAR struct inode *inode; FAR struct pty_dev_s *dev; ssize_t ntotal; -#ifdef CONFIG_SERIAL_TERMIOS ssize_t nwritten; size_t i; char ch; -#endif DEBUGASSERT(filep != NULL && filep->f_inode != NULL); inode = filep->f_inode; dev = inode->i_private; DEBUGASSERT(dev != NULL); -#ifdef CONFIG_SERIAL_TERMIOS /* Do output post-processing */ if ((dev->pd_oflag & OPOST) != 0) @@ -694,7 +687,6 @@ static ssize_t pty_write(FAR struct file *filep, } } else -#endif { /* Write the 'len' bytes to the sink pipe. This will block until all * 'len' bytes have been written to the pipe. @@ -1086,9 +1078,7 @@ int pty_register(int minor) devpair->pp_master.pd_devpair = devpair; devpair->pp_master.pd_master = true; devpair->pp_slave.pd_devpair = devpair; -#ifdef CONFIG_SERIAL_TERMIOS devpair->pp_slave.pd_oflag = OPOST | ONLCR; -#endif /* Create two pipes: *