Trivial cleanups
This commit is contained in:
+3
-3
@@ -132,7 +132,7 @@ int telnet_rx(tn_ctx_t * tcc, char *buf, size_t * plen)
|
|||||||
len = *plen;
|
len = *plen;
|
||||||
tcc->bytes_rx += len;
|
tcc->bytes_rx += len;
|
||||||
|
|
||||||
if (len < (size_t)tcc->off_rx)
|
if (len < (size_t) tcc->off_rx)
|
||||||
tcc->off_rx = 0;
|
tcc->off_rx = 0;
|
||||||
|
|
||||||
for (s = buf + tcc->off_rx, rem = len - tcc->off_rx; rem > 0; s = p)
|
for (s = buf + tcc->off_rx, rem = len - tcc->off_rx; rem > 0; s = p)
|
||||||
@@ -169,7 +169,7 @@ int telnet_rx(tn_ctx_t * tcc, char *buf, size_t * plen)
|
|||||||
case TNC_FD_DO:
|
case TNC_FD_DO:
|
||||||
case TNC_FE_DONT:
|
case TNC_FE_DONT:
|
||||||
if (np < 3)
|
if (np < 3)
|
||||||
goto tn_more; /* Need more */
|
goto tn_more; /* Need more */
|
||||||
tcc->mode_telnet = 1; /* Any such sequence activates TN */
|
tcc->mode_telnet = 1; /* Any such sequence activates TN */
|
||||||
b2 = pu[2];
|
b2 = pu[2];
|
||||||
if (b1 == TNC_FB_WILL)
|
if (b1 == TNC_FB_WILL)
|
||||||
@@ -195,7 +195,7 @@ int telnet_rx(tn_ctx_t * tcc, char *buf, size_t * plen)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (np < 16)
|
if (np < 16)
|
||||||
goto tn_more; /* Not done */
|
goto tn_more; /* Not done */
|
||||||
/* This does not look right */
|
/* This does not look right */
|
||||||
rem = 0; /* Quit loop */
|
rem = 0; /* Quit loop */
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -148,10 +148,10 @@ static void ttynvt_release(fuse_req_t req, struct fuse_file_info *info)
|
|||||||
close(tty->fds[FD_MASTER].fd);
|
close(tty->fds[FD_MASTER].fd);
|
||||||
close(tty->fds[FD_SLAVE].fd);
|
close(tty->fds[FD_SLAVE].fd);
|
||||||
|
|
||||||
(void)pthread_cancel(tty->thread_id);
|
pthread_cancel(tty->thread_id);
|
||||||
(void)pthread_join(tty->thread_id, NULL);
|
pthread_join(tty->thread_id, NULL);
|
||||||
(void)pthread_mutex_destroy(&tty->tty_lock);
|
pthread_mutex_destroy(&tty->tty_lock);
|
||||||
(void)pthread_mutex_destroy(&tty->poll_lock);
|
pthread_mutex_destroy(&tty->poll_lock);
|
||||||
|
|
||||||
if (tty->ph)
|
if (tty->ph)
|
||||||
fuse_pollhandle_destroy(tty->ph);
|
fuse_pollhandle_destroy(tty->ph);
|
||||||
@@ -330,7 +330,7 @@ static int _srv_read(void *cctx, int timeout)
|
|||||||
static void _modem_status_cb(void *cctx, int status)
|
static void _modem_status_cb(void *cctx, int status)
|
||||||
{
|
{
|
||||||
ttynvt_t *tty = cctx;
|
ttynvt_t *tty = cctx;
|
||||||
int mcr = 0;
|
int mcr = 0;
|
||||||
|
|
||||||
DBG("MCR: DSR=%c CTS=%c RI=%c CD=%c\n",
|
DBG("MCR: DSR=%c CTS=%c RI=%c CD=%c\n",
|
||||||
status & TNS_STATE_DSR ? '1' : '0',
|
status & TNS_STATE_DSR ? '1' : '0',
|
||||||
|
|||||||
Reference in New Issue
Block a user