Cosmetics

This commit is contained in:
Kim Woelders
2018-10-15 07:57:26 +02:00
parent 00430e5f64
commit 2d993212c5
+9 -7
View File
@@ -66,12 +66,13 @@ typedef struct {
char tmp_buf[TMP_BUF_SIZE]; char tmp_buf[TMP_BUF_SIZE];
struct termios tio; struct termios tio;
int cmcr;
int epipe;
int cmcr;
volatile int smcr; volatile int smcr;
volatile int error;
volatile int pollin; volatile int pollin;
volatile int error;
int epipe;
tn_ctx_t *tn; tn_ctx_t *tn;
} ttynvt_t; } ttynvt_t;
@@ -201,9 +202,9 @@ static void *_read_net(void *arg)
{ {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
else break;
break;
} }
if (tty->fds[FD_NET].revents & POLLIN) if (tty->fds[FD_NET].revents & POLLIN)
{ {
res = read(tty->fds[FD_NET].fd, tty->net_buf + tty->net_cnt, res = read(tty->fds[FD_NET].fd, tty->net_buf + tty->net_cnt,
@@ -213,7 +214,7 @@ static void *_read_net(void *arg)
_log(LOG_ERR, "net read error: %s\n", strerror(errno)); _log(LOG_ERR, "net read error: %s\n", strerror(errno));
break; break;
} }
else if (res == 0) if (res == 0)
{ {
_log(LOG_INFO, "Connection closed by remote host\n"); _log(LOG_INFO, "Connection closed by remote host\n");
break; break;
@@ -232,6 +233,7 @@ static void *_read_net(void *arg)
tty->net_cnt = 0; tty->net_cnt = 0;
} }
} }
if (tty->fds[FD_MASTER].revents & POLLIN) if (tty->fds[FD_MASTER].revents & POLLIN)
{ {
res = read(tty->fds[FD_MASTER].fd, tty->tmp_buf, TMP_BUF_SIZE); res = read(tty->fds[FD_MASTER].fd, tty->tmp_buf, TMP_BUF_SIZE);
@@ -242,6 +244,7 @@ static void *_read_net(void *arg)
} }
telnet_tx(tty->tn, tty->tmp_buf, res); telnet_tx(tty->tn, tty->tmp_buf, res);
} }
if (tty->fds[FD_SLAVE].revents & POLLIN) if (tty->fds[FD_SLAVE].revents & POLLIN)
{ {
tty->pollin = 1; tty->pollin = 1;
@@ -838,7 +841,6 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
case TIOCSETD: case TIOCSETD:
CHECK_BUF_IN(sizeof(int)); CHECK_BUF_IN(sizeof(int));
val = *(int *)in_buf; val = *(int *)in_buf;
res = ioctl(tty->fds[FD_SLAVE].fd, TIOCSETD, &val); res = ioctl(tty->fds[FD_SLAVE].fd, TIOCSETD, &val);
if (res < 0) if (res < 0)
fuse_reply_err(req, errno); fuse_reply_err(req, errno);