aboutsummaryrefslogtreecommitdiff
path: root/nuttx/lib/stdio/lib_rawoutstream.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-14 14:42:50 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-14 14:42:50 +0000
commitaa09e054326770824994f0ee7bb07d3155484337 (patch)
treeb7f43cc028560883de0ec4c9bf58b345dbadb02e /nuttx/lib/stdio/lib_rawoutstream.c
parenta72ff3b651c8b4a13c4791fb1829c94ed0ce88ed (diff)
downloadpx4-firmware-aa09e054326770824994f0ee7bb07d3155484337.tar.gz
px4-firmware-aa09e054326770824994f0ee7bb07d3155484337.tar.bz2
px4-firmware-aa09e054326770824994f0ee7bb07d3155484337.zip
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
Diffstat (limited to 'nuttx/lib/stdio/lib_rawoutstream.c')
-rw-r--r--nuttx/lib/stdio/lib_rawoutstream.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nuttx/lib/stdio/lib_rawoutstream.c b/nuttx/lib/stdio/lib_rawoutstream.c
index 6adf9b53d..ed813f87a 100644
--- a/nuttx/lib/stdio/lib_rawoutstream.c
+++ b/nuttx/lib/stdio/lib_rawoutstream.c
@@ -59,9 +59,11 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch)
DEBUGASSERT(this && rthis->fd >= 0);
- /* Loop until the character is successfully transferred */
+ /* Loop until the character is successfully transferred or until an
+ * irrecoverable error occurs.
+ */
- for (;;)
+ do
{
nwritten = write(rthis->fd, &buffer, 1);
if (nwritten == 1)
@@ -75,8 +77,9 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch)
* from write().
*/
- DEBUGASSERT(nwritten < 0 && get_errno() == EINTR);
+ DEBUGASSERT(nwritten < 0);
}
+ while (get_errno() == EINTR);
}
/****************************************************************************