Fixed an endless loop in tty_write_to_tty() that happened if there was not enough

space left to write a '\r\n'. This fixes bug #80 and probably bug #477, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17479 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-05-16 14:33:06 +00:00
parent 04b1590767
commit 94f687f9e3
1 changed files with 3 additions and 0 deletions

View File

@ -1245,7 +1245,10 @@ tty_write_to_tty(tty_cookie *sourceCookie, const void *buffer, size_t *_length,
// If we can't write both '\r' and '\n', we won't write either,
// or we would write the '\r' again.
if (writable < 2) {
// try acquiring the writer again, when enough space is available
bytesNeeded = 2;
writable = 0;
// make sure we're breaking out of this loop
continue;
}