Revise recent changes to serial driver error handling: Errors other than EINTR may be returned when the driver is used very early in initialization. STM32 SPI driver will now survive repeated initializations

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5026 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-08-14 14:42:50 +00:00
parent a72ff3b651
commit aa09e05432
5 changed files with 48 additions and 31 deletions
+6 -5
View File
@@ -58,9 +58,11 @@ static void stdoutstream_putc(FAR struct lib_outstream_s *this, int ch)
DEBUGASSERT(this && sthis->stream);
/* Loop until the character is successfully transferred */
/* Loop until the character is successfully transferred or an irrecoverable
* error occurs.
*/
for (;;)
do
{
result = fputc(ch, sthis->stream);
if (result != EOF)
@@ -70,11 +72,10 @@ static void stdoutstream_putc(FAR struct lib_outstream_s *this, int ch)
}
/* EINTR (meaning that fputc was interrupted by a signal) is the only
* expected error.
* recoverable error.
*/
DEBUGASSERT(get_errno() == EINTR);
}
while (get_errno() == EINTR);
}
/****************************************************************************