fix PR bin/22464 (hang up on kterm)
This commit is contained in:
parent
fa2d773e2e
commit
e0a59ddcd9
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ttinit.c,v 1.7 2003/08/07 11:17:31 agc Exp $ */
|
||||
/* $NetBSD: ttinit.c,v 1.8 2003/08/13 15:13:46 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ttinit.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ttinit.c,v 1.7 2003/08/07 11:17:31 agc Exp $");
|
||||
__RCSID("$NetBSD: ttinit.c,v 1.8 2003/08/13 15:13:46 itojun Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -81,6 +81,8 @@ ttinit(void)
|
|||
* Set output buffer size to about 1 second of output time.
|
||||
*/
|
||||
i = MIN(wwbaud/10, 512);
|
||||
if (i == 0)
|
||||
i = 512;
|
||||
if ((tt_ob = malloc((unsigned) i)) == 0) {
|
||||
wwerrno = WWE_NOMEM;
|
||||
return -1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ttoutput.c,v 1.6 2003/08/07 11:17:31 agc Exp $ */
|
||||
/* $NetBSD: ttoutput.c,v 1.7 2003/08/13 15:13:46 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ttoutput.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ttoutput.c,v 1.6 2003/08/07 11:17:31 agc Exp $");
|
||||
__RCSID("$NetBSD: ttoutput.c,v 1.7 2003/08/13 15:13:46 itojun Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -137,7 +137,7 @@ ttwrite(char *s, int n)
|
|||
while (n > 0) {
|
||||
int m;
|
||||
|
||||
while ((m = tt_obe - tt_obp) == 0)
|
||||
if ((m = tt_obe - tt_obp) < n)
|
||||
ttflush();
|
||||
if ((m = tt_obe - tt_obp) > n)
|
||||
m = n;
|
||||
|
|
Loading…
Reference in New Issue