tty: conditionally assign to ret value only used by MPASS statement
This commit is contained in:
parent
d02acb9927
commit
3b202e89e0
@ -328,13 +328,15 @@ ttyinq_write(struct ttyinq *ti, const void *buf, size_t nbytes, int quote)
|
||||
int
|
||||
ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote)
|
||||
{
|
||||
#ifdef INVARIANTS
|
||||
size_t ret;
|
||||
#endif
|
||||
|
||||
if (ttyinq_bytesleft(ti) < nbytes)
|
||||
return (-1);
|
||||
|
||||
/* We should always be able to write it back. */
|
||||
ret = ttyinq_write(ti, buf, nbytes, quote);
|
||||
DBGSET(ret, ttyinq_write(ti, buf, nbytes, quote));
|
||||
MPASS(ret == nbytes);
|
||||
|
||||
return (0);
|
||||
|
@ -324,13 +324,15 @@ ttyoutq_write(struct ttyoutq *to, const void *buf, size_t nbytes)
|
||||
int
|
||||
ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes)
|
||||
{
|
||||
#ifdef INVARIANTS
|
||||
size_t ret;
|
||||
#endif
|
||||
|
||||
if (ttyoutq_bytesleft(to) < nbytes)
|
||||
return (-1);
|
||||
|
||||
/* We should always be able to write it back. */
|
||||
ret = ttyoutq_write(to, buf, nbytes);
|
||||
DBGSET(ret, ttyoutq_write(to, buf, nbytes));
|
||||
MPASS(ret == nbytes);
|
||||
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user