Update Use loop in Console Write
This ensures that the return value of the write() call is checked,
and avoids a potential compiler warning.  There is still no recourse if
the write call fails, but it can retry if it was short.
@@ -63,9 +63,22 @@ static void OS_BSP_ExecTput(const char *cap, const char *param)
See full description in header
------------------------------------------------------------------*/
void OS_BSP_ConsoleOutput_Impl(const char *Str, uint32 DataLen)
+{
+ ssize_t WriteLen;
+
+ do
{
/* writes the raw data directly to STDOUT_FILENO (unbuffered) */
- write(STDOUT_FILENO, Str, DataLen);
+ WriteLen = write(STDOUT_FILENO, Str, DataLen);
+ if (WriteLen <= 0)
+ {
+ /* no recourse if this fails, just stop. */
+ break;
+ }
+ Str += WriteLen;
+ DataLen -= WriteLen;
+ }
+ while(true);
}
/*----------------------------------------------------------------
