mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Revert part of last change
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1285 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+3
-3
@@ -56,7 +56,7 @@
|
||||
static ssize_t devnull_read(FAR struct file *, FAR char *, size_t);
|
||||
static ssize_t devnull_write(FAR struct file *, FAR const char *, size_t);
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds, boolean setup);
|
||||
static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -103,9 +103,9 @@ static ssize_t devnull_write(FAR struct file *filp, FAR const char *buffer, size
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds, boolean setup)
|
||||
static int devnull_poll(FAR struct file *filp, FAR struct pollfd *fds)
|
||||
{
|
||||
if (setup)
|
||||
if (fds)
|
||||
{
|
||||
fds->revents |= (fds->events & (POLLIN|POLLOUT));
|
||||
if (fds->revents != 0)
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@
|
||||
static ssize_t devzero_read(FAR struct file *, FAR char *, size_t);
|
||||
static ssize_t devzero_write(FAR struct file *, FAR const char *, size_t);
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds, boolean setup);
|
||||
static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -104,9 +104,9 @@ static ssize_t devzero_write(FAR struct file *filp, FAR const char *buffer, size
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds, boolean setup)
|
||||
static int devzero_poll(FAR struct file *filp, FAR struct pollfd *fds)
|
||||
{
|
||||
if (setup)
|
||||
if (fds)
|
||||
{
|
||||
fds->revents |= (fds->events & (POLLIN|POLLOUT));
|
||||
if (fds->revents != 0)
|
||||
|
||||
+9
-12
@@ -517,7 +517,7 @@ ssize_t pipecommon_write(FAR struct file *filep, FAR const char *buffer, size_t
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup)
|
||||
int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct pipe_dev_s *dev = inode->i_private;
|
||||
@@ -547,14 +547,14 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setu
|
||||
|
||||
if (dev->d_fds[i] == filep->f_priv)
|
||||
{
|
||||
dev->d_fds[i] = (setup ? fds : NULL);
|
||||
dev->d_fds[i] = fds;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= CONFIG_DEV_PIPE_NPOLLWAITERS)
|
||||
{
|
||||
DEBUGASSERT(setup);
|
||||
DEBUGASSERT(fds != NULL);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
@@ -562,16 +562,13 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setu
|
||||
* 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)
|
||||
{
|
||||
/* Set the poll event structure reference in the 'struct file' private data. */
|
||||
|
||||
filep->f_priv = fds;
|
||||
|
||||
/* Check if we should immediately notify on any of the requested events. First,
|
||||
* Determine how many bytes are in the buffer
|
||||
*/
|
||||
/* Determine how many bytes are in the buffer */
|
||||
|
||||
if (dev->d_wrndx >= dev->d_rdndx)
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ EXTERN int pipecommon_close(FAR struct file *filep);
|
||||
EXTERN ssize_t pipecommon_read(FAR struct file *, FAR char *, size_t);
|
||||
EXTERN ssize_t pipecommon_write(FAR struct file *, FAR const char *, size_t);
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
EXTERN int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup);
|
||||
EXTERN int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
+10
-9
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user