forked from nuttx/nuttx-update
serial/pty: Sync the default termios setting regardless CONFIG_SERIAL_TERMIOS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
3ec208fdbc
commit
61066ecbc8
1 changed files with 2 additions and 12 deletions
|
@ -120,14 +120,10 @@ struct pty_dev_s
|
||||||
struct file pd_src; /* Provides data to read() method (pipe output) */
|
struct file pd_src; /* Provides data to read() method (pipe output) */
|
||||||
struct file pd_sink; /* Accepts data from write() method (pipe input) */
|
struct file pd_sink; /* Accepts data from write() method (pipe input) */
|
||||||
bool pd_master; /* True: this is the master */
|
bool pd_master; /* True: this is the master */
|
||||||
|
|
||||||
#ifdef CONFIG_SERIAL_TERMIOS
|
#ifdef CONFIG_SERIAL_TERMIOS
|
||||||
/* Terminal control flags */
|
tcflag_t pd_iflag; /* Terminal input modes */
|
||||||
|
|
||||||
tcflag_t pd_iflag; /* Terminal nput modes */
|
|
||||||
tcflag_t pd_oflag; /* Terminal output modes */
|
|
||||||
#endif
|
#endif
|
||||||
|
tcflag_t pd_oflag; /* Terminal output modes */
|
||||||
struct pty_poll_s pd_poll[CONFIG_DEV_PTY_NPOLLWAITERS];
|
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 inode *inode;
|
||||||
FAR struct pty_dev_s *dev;
|
FAR struct pty_dev_s *dev;
|
||||||
ssize_t ntotal;
|
ssize_t ntotal;
|
||||||
#ifdef CONFIG_SERIAL_TERMIOS
|
|
||||||
ssize_t nwritten;
|
ssize_t nwritten;
|
||||||
size_t i;
|
size_t i;
|
||||||
char ch;
|
char ch;
|
||||||
#endif
|
|
||||||
|
|
||||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||||
inode = filep->f_inode;
|
inode = filep->f_inode;
|
||||||
dev = inode->i_private;
|
dev = inode->i_private;
|
||||||
DEBUGASSERT(dev != NULL);
|
DEBUGASSERT(dev != NULL);
|
||||||
|
|
||||||
#ifdef CONFIG_SERIAL_TERMIOS
|
|
||||||
/* Do output post-processing */
|
/* Do output post-processing */
|
||||||
|
|
||||||
if ((dev->pd_oflag & OPOST) != 0)
|
if ((dev->pd_oflag & OPOST) != 0)
|
||||||
|
@ -694,7 +687,6 @@ static ssize_t pty_write(FAR struct file *filep,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* Write the 'len' bytes to the sink pipe. This will block until all
|
/* Write the 'len' bytes to the sink pipe. This will block until all
|
||||||
* 'len' bytes have been written to the pipe.
|
* '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_devpair = devpair;
|
||||||
devpair->pp_master.pd_master = true;
|
devpair->pp_master.pd_master = true;
|
||||||
devpair->pp_slave.pd_devpair = devpair;
|
devpair->pp_slave.pd_devpair = devpair;
|
||||||
#ifdef CONFIG_SERIAL_TERMIOS
|
|
||||||
devpair->pp_slave.pd_oflag = OPOST | ONLCR;
|
devpair->pp_slave.pd_oflag = OPOST | ONLCR;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Create two pipes:
|
/* Create two pipes:
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue