From 94f687f9e36d52176289c7a51a66da8b3b5a13ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 16 May 2006 14:33:06 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/drivers/tty/tty.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/kernel/drivers/tty/tty.cpp b/src/add-ons/kernel/drivers/tty/tty.cpp index 42b8fea1ee..2dbddbc95f 100644 --- a/src/add-ons/kernel/drivers/tty/tty.cpp +++ b/src/add-ons/kernel/drivers/tty/tty.cpp @@ -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; }