diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-12 17:37:04 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-12 17:37:04 +0000 |
commit | 2b184e2630f74fe4f568212de7e143a9bc3743b8 (patch) | |
tree | b8701e6c319c085758d39c4dd7d08c380fc2088a /nuttx/lib/stdio/lib_memoutstream.c | |
parent | 0512367a9c707f26b9a2b9057cf64714f46a0dc4 (diff) | |
download | px4-firmware-2b184e2630f74fe4f568212de7e143a9bc3743b8.tar.gz px4-firmware-2b184e2630f74fe4f568212de7e143a9bc3743b8.tar.bz2 px4-firmware-2b184e2630f74fe4f568212de7e143a9bc3743b8.zip |
drivers/serial/serial.c open, read, write, and poll methods will not return a short transfer or an EINTR error if a signal is received while waiting (only)
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5022 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/lib/stdio/lib_memoutstream.c')
-rw-r--r-- | nuttx/lib/stdio/lib_memoutstream.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nuttx/lib/stdio/lib_memoutstream.c b/nuttx/lib/stdio/lib_memoutstream.c index 007ab8976..21197358b 100644 --- a/nuttx/lib/stdio/lib_memoutstream.c +++ b/nuttx/lib/stdio/lib_memoutstream.c @@ -37,6 +37,8 @@ * Included Files ****************************************************************************/ +#include <assert.h> + #include "lib_internal.h" /**************************************************************************** @@ -51,12 +53,14 @@ static void memoutstream_putc(FAR struct lib_outstream_s *this, int ch) { FAR struct lib_memoutstream_s *mthis = (FAR struct lib_memoutstream_s *)this; + DEBUGASSERT(this); + /* If this will not overrun the buffer, then write the character to the * buffer. Not that buflen was pre-decremented when the stream was * created so it is okay to write past the end of the buflen by one. */ - if (this && this->nput < mthis->buflen) + if (this->nput < mthis->buflen) { mthis->buffer[this->nput] = ch; this->nput++; |