Fix a readline bug. If a NUL is received, it would return end-of-file

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5633 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-02-10 00:46:27 +00:00
parent 319c9f7783
commit ad447766ff
4 changed files with 16 additions and 15 deletions
+5 -3
View File
@@ -528,7 +528,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
* return what we have.
*/
else if (filep->f_oflags & O_NONBLOCK)
else if ((filep->f_oflags & O_NONBLOCK) != 0)
{
/* If nothing was transferred, then return the -EAGAIN
* error (not zero which means end of file).
@@ -560,7 +560,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
* wait.
*/
else if (filep->f_oflags & O_NONBLOCK)
else if ((filep->f_oflags & O_NONBLOCK) != 0)
{
/* Break out of the loop returning -EAGAIN */
@@ -1109,7 +1109,9 @@ void uart_connected(FAR uart_dev_t *dev, bool connected)
{
irqstate_t flags;
/* Is the device disconnected? */
/* Is the device disconnected? Interrupts are disabled because this
* function may be called from interrupt handling logic.
*/
flags = irqsave();
dev->disconnected = !connected;