You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/10/19 12:47:01 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2036: serial: break from read after closing

xiaoxiang781216 commented on a change in pull request #2036:
URL: https://github.com/apache/incubator-nuttx/pull/2036#discussion_r507716319



##########
File path: drivers/serial/serial.c
##########
@@ -1761,7 +1771,7 @@ void uart_connected(FAR uart_dev_t *dev, bool connected)
 void uart_reset_sem(FAR uart_dev_t *dev)
 {
   nxsem_reset(&dev->xmitsem,  0);
-  nxsem_reset(&dev->recvsem,  0);
+  nxsem_reset(&dev->recvsem,  1);

Review comment:
       should we change 0 to dev->recvwaiting?

##########
File path: drivers/serial/serial.c
##########
@@ -854,6 +854,16 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
           break;
         }
 
+      else if (filep->f_inode == 0)

Review comment:
       check in uart_write?

##########
File path: drivers/serial/serial.c
##########
@@ -1761,7 +1771,7 @@ void uart_connected(FAR uart_dev_t *dev, bool connected)
 void uart_reset_sem(FAR uart_dev_t *dev)
 {
   nxsem_reset(&dev->xmitsem,  0);

Review comment:
       should we change 0 to dev->xmitwaiting?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org