forked from Imagelibrary/rtems
libcsupport/termios: Wake receiver when ICANON settings change
Closes #5307
This commit is contained in:
committed by
Kinsey Moore
parent
8d73c4914e
commit
3a2b37826f
@@ -770,6 +770,9 @@ rtems_termios_ioctl (void *arg)
|
|||||||
rtems_libio_ioctl_args_t *args = arg;
|
rtems_libio_ioctl_args_t *args = arg;
|
||||||
struct rtems_termios_tty *tty = args->iop->data1;
|
struct rtems_termios_tty *tty = args->iop->data1;
|
||||||
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
|
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
|
||||||
|
bool rawInBufSemaphoreWait;
|
||||||
|
int rawInBufSemaphoreTimeout;
|
||||||
|
int rawInBufSemaphoreFirstTimeout;
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
@@ -807,6 +810,10 @@ rtems_termios_ioctl (void *arg)
|
|||||||
/* check for and process change in flow control options */
|
/* check for and process change in flow control options */
|
||||||
termios_set_flowctrl(tty);
|
termios_set_flowctrl(tty);
|
||||||
|
|
||||||
|
rawInBufSemaphoreWait = tty->rawInBufSemaphoreWait;
|
||||||
|
rawInBufSemaphoreTimeout = tty->rawInBufSemaphoreTimeout;
|
||||||
|
rawInBufSemaphoreFirstTimeout = tty->rawInBufSemaphoreFirstTimeout;
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ICANON) {
|
if (tty->termios.c_lflag & ICANON) {
|
||||||
tty->rawInBufSemaphoreWait = true;
|
tty->rawInBufSemaphoreWait = true;
|
||||||
tty->rawInBufSemaphoreTimeout = 0;
|
tty->rawInBufSemaphoreTimeout = 0;
|
||||||
@@ -835,6 +842,12 @@ rtems_termios_ioctl (void *arg)
|
|||||||
sc = (*tty->handler.set_attributes)(tty->device_context, &tty->termios) ?
|
sc = (*tty->handler.set_attributes)(tty->device_context, &tty->termios) ?
|
||||||
RTEMS_SUCCESSFUL : RTEMS_IO_ERROR;
|
RTEMS_SUCCESSFUL : RTEMS_IO_ERROR;
|
||||||
}
|
}
|
||||||
|
if (rawInBufSemaphoreWait == tty->rawInBufSemaphoreWait ||
|
||||||
|
rawInBufSemaphoreTimeout == tty->rawInBufSemaphoreTimeout ||
|
||||||
|
rawInBufSemaphoreFirstTimeout ==
|
||||||
|
tty->rawInBufSemaphoreFirstTimeout) {
|
||||||
|
rtems_binary_semaphore_post (&tty->rawInBuf.Semaphore);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TIOCDRAIN:
|
case TIOCDRAIN:
|
||||||
|
|||||||
Reference in New Issue
Block a user