mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
A lack of console input is not the same thing as a byte of \0 input.
Correctly return -1 from cngetc when no input is available to be read. This fixes the '(CTRL-C to abort)' spam while dumping. MFC after: 3 days
This commit is contained in:
parent
bd2fa726e0
commit
eb68ccd676
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216790
@ -125,17 +125,18 @@ xc_cnterm(struct consdev *cp)
|
||||
static int
|
||||
xc_cngetc(struct consdev *dev)
|
||||
{
|
||||
int ret = (xc_mute ? 0 : -1);
|
||||
int ret;
|
||||
|
||||
if (xencons_has_input())
|
||||
xencons_handle_input(NULL);
|
||||
|
||||
CN_LOCK(cn_mtx);
|
||||
if ((rp - rc)) {
|
||||
if ((rp - rc) && !xc_mute) {
|
||||
/* we need to return only one char */
|
||||
ret = (int)rbuf[RBUF_MASK(rc)];
|
||||
rc++;
|
||||
}
|
||||
} else
|
||||
ret = -1;
|
||||
CN_UNLOCK(cn_mtx);
|
||||
return(ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user