summaryrefslogtreecommitdiff
path: root/nuttx/lib/stdio/lib_lowinstream.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-12 17:37:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-12 17:37:04 +0000
commit4d7cbe088ed6ea14adc0672b339f1e0df4650f00 (patch)
treeb8701e6c319c085758d39c4dd7d08c380fc2088a /nuttx/lib/stdio/lib_lowinstream.c
parent66fcc36c58e7670ef627985cc37ac99dc747c02f (diff)
downloadpx4-nuttx-4d7cbe088ed6ea14adc0672b339f1e0df4650f00.tar.gz
px4-nuttx-4d7cbe088ed6ea14adc0672b339f1e0df4650f00.tar.bz2
px4-nuttx-4d7cbe088ed6ea14adc0672b339f1e0df4650f00.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: svn://svn.code.sf.net/p/nuttx/code/trunk@5022 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/stdio/lib_lowinstream.c')
-rw-r--r--nuttx/lib/stdio/lib_lowinstream.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/nuttx/lib/stdio/lib_lowinstream.c b/nuttx/lib/stdio/lib_lowinstream.c
index 6dcc4a37e..c97a4721f 100644
--- a/nuttx/lib/stdio/lib_lowinstream.c
+++ b/nuttx/lib/stdio/lib_lowinstream.c
@@ -1,8 +1,8 @@
/****************************************************************************
* lib/stdio/lib_lowinstream.c
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -42,7 +42,9 @@
#ifdef CONFIG_ARCH_LOWGETC
#include <stdio.h>
+#include <assert.h>
#include <errno.h>
+
#include <nuttx/arch.h>
#include "lib_internal.h"
@@ -57,10 +59,19 @@
static int lowinstream_getc(FAR struct lib_instream_s *this)
{
- if (this && up_getc(ch) != EOF)
+ int ret;
+
+ DEBUGASSERT(this);
+
+ /* Get the next character from the incoming stream */
+
+ ret = up_getc(ch)
+ if (ret != EOF)
{
this->nget++;
}
+
+ return ret;
}
/****************************************************************************