Flushing ioctl fixups
- Propagate TCFLSH to slave. - Actually send flush requests to server. - TCIFLUSH, TCOFLUSH, and TCIOFLUSH are not ioctls but TCFLSH arguments. - Re-enable read polls if input is flushed.
This commit is contained in:
@@ -665,9 +665,6 @@ static const char *_ioctl_name(int cmd)
|
||||
CASE(TIOCINQ);
|
||||
CASE(TIOCOUTQ);
|
||||
CASE(TCFLSH);
|
||||
CASE(TCIFLUSH);
|
||||
CASE(TCOFLUSH);
|
||||
CASE(TCIOFLUSH);
|
||||
CASE(TIOCMGET);
|
||||
CASE(TIOCMBIS);
|
||||
CASE(TIOCMBIC);
|
||||
@@ -784,6 +781,9 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
|
||||
|
||||
ioctl(tty->fds[FD_SLAVE].fd, cmd, tio);
|
||||
|
||||
if (cmd == TCSETSF)
|
||||
tty->n_fds = 3; /* Re-enable polling of Slave */
|
||||
|
||||
fuse_reply_ioctl(req, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
@@ -805,33 +805,23 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
|
||||
fuse_reply_ioctl(req, 0, &val, sizeof(int));
|
||||
break;
|
||||
case TCFLSH:
|
||||
if (arg == TCIFLUSH)
|
||||
switch ((size_t) arg)
|
||||
{
|
||||
/*todo */
|
||||
}
|
||||
else if ((size_t) arg == TCOFLUSH)
|
||||
{
|
||||
/*todo */
|
||||
}
|
||||
else if ((size_t) arg == TCIOFLUSH)
|
||||
{
|
||||
/*todo */
|
||||
}
|
||||
fuse_reply_ioctl(req, 0, 0, 0);
|
||||
break;
|
||||
default:
|
||||
case TCIFLUSH:
|
||||
byte = 1;
|
||||
telnet_rfc2217_cfg(tty->tn, TNS_SET_PURGE, &byte, 1);
|
||||
fuse_reply_ioctl(req, 0, 0, 0);
|
||||
tty->n_fds = 3; /* Re-enable polling of Slave */
|
||||
break;
|
||||
case TCOFLUSH:
|
||||
byte = 2;
|
||||
telnet_rfc2217_cfg(tty->tn, TNS_SET_PURGE, &byte, 1);
|
||||
fuse_reply_ioctl(req, 0, 0, 0);
|
||||
break;
|
||||
case TCIOFLUSH:
|
||||
byte = 3;
|
||||
tty->n_fds = 3; /* Re-enable polling of Slave */
|
||||
break;
|
||||
}
|
||||
telnet_rfc2217_cfg(tty->tn, TNS_SET_PURGE, &byte, 1);
|
||||
ioctl(tty->fds[FD_SLAVE].fd, TCFLSH, arg);
|
||||
fuse_reply_ioctl(req, 0, 0, 0);
|
||||
break;
|
||||
case TIOCMGET:
|
||||
|
||||
Reference in New Issue
Block a user