diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-19 02:39:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-19 02:39:21 +0000 |
commit | 9cf192e2eca3b7d266e25a49a02008fe015ff389 (patch) | |
tree | b72c2245db1837de8cf286ac919242c220307b36 /nuttx/drivers/serial.c | |
parent | c0b98435519199874716495c3654fffff8f6fab9 (diff) | |
download | px4-nuttx-9cf192e2eca3b7d266e25a49a02008fe015ff389.tar.gz px4-nuttx-9cf192e2eca3b7d266e25a49a02008fe015ff389.tar.bz2 px4-nuttx-9cf192e2eca3b7d266e25a49a02008fe015ff389.zip |
Revert part of last change
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1285 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/serial.c')
-rw-r--r-- | nuttx/drivers/serial.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nuttx/drivers/serial.c b/nuttx/drivers/serial.c index 0effeff00..4e409fa06 100644 --- a/nuttx/drivers/serial.c +++ b/nuttx/drivers/serial.c @@ -79,7 +79,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t buflen); static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg); #ifndef CONFIG_DISABLE_POLL -static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup); +static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds); #endif /************************************************************************************ @@ -400,7 +400,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ****************************************************************************/ #ifndef CONFIG_DISABLE_POLL -int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) +int uart_poll(FAR struct file *filep, FAR struct pollfd *fds) { FAR struct inode *inode = filep->f_inode; FAR uart_dev_t *dev = inode->i_private; @@ -430,14 +430,14 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) if (dev->fds[i] == filep->f_priv) { - dev->fds[i] = (setup ? fds : NULL); + dev->fds[i] = fds; break; } } if (i >= CONFIG_DEV_CONSOLE_NPOLLWAITERS) { - DEBUGASSERT(setup); + DEBUGASSERT(fds != NULL); return -EBUSY; } @@ -445,12 +445,13 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup) * private data. */ - filep->f_priv = NULL; /* Assume teardown */ - if (setup) + filep->f_priv = fds; + + /* Check if we should immediately notify on any of the requested events */ + + if (fds) { - /* Check if we should immediately notify on any of the requested events. - * First, check if the xmit buffer is full. - */ + /* Check if the xmit buffer is full. */ eventset = 0; |