diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index c85b0c767d4..12d8efe674e 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -46,7 +46,7 @@ static int nxmq_file_close(FAR struct file *filep); static int nxmq_file_poll(FAR struct file *filep, - struct pollfd *fds, bool setup); + FAR struct pollfd *fds, bool setup); /**************************************************************************** * Private Data @@ -88,7 +88,7 @@ static int nxmq_file_close(FAR struct file *filep) } static int nxmq_file_poll(FAR struct file *filep, - struct pollfd *fds, bool setup) + FAR struct pollfd *fds, bool setup) { FAR struct inode *inode = filep->f_inode; FAR struct mqueue_inode_s *msgq = inode->i_private; @@ -105,7 +105,7 @@ static int nxmq_file_poll(FAR struct file *filep, { /* Find an available slot */ - if (!msgq->fds[i]) + if (msgq->fds[i] == NULL) { /* Bind the poll structure and this slot */ @@ -129,7 +129,7 @@ static int nxmq_file_poll(FAR struct file *filep, eventset |= POLLOUT; } - if (msgq->nmsgs) + if (msgq->nmsgs > 0) { eventset |= POLLIN; } @@ -155,7 +155,8 @@ errout: } static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name, - int oflags, mode_t umask, va_list ap, int *created) + int oflags, mode_t umask, va_list ap, + FAR int *created) { FAR struct inode *inode; FAR struct mqueue_inode_s *msgq;