A little more clean-up of poll() error handling

This commit is contained in:
Gregory Nutt
2014-09-26 08:25:00 -06:00
parent a05107e7fe
commit 79eeb9f1b5
2 changed files with 19 additions and 19 deletions
+4 -4
View File
@@ -292,8 +292,6 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
if (timeout == 0) if (timeout == 0)
{ {
/* Poll returns immediately whether we have a poll event or not. */ /* Poll returns immediately whether we have a poll event or not. */
ret = sem_trywait(&sem);
} }
else if (timeout > 0) else if (timeout > 0)
{ {
@@ -326,7 +324,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
abstime.tv_nsec -= NSEC_PER_SEC; abstime.tv_nsec -= NSEC_PER_SEC;
} }
ret = sem_timedwait(&sem, &abstime); (void)sem_timedwait(&sem, &abstime);
irqrestore(flags); irqrestore(flags);
} }
else else
@@ -336,7 +334,9 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
poll_semtake(&sem); poll_semtake(&sem);
} }
/* Teardown the poll operation and get the count of events */ /* Teardown the poll operation and get the count of events. Zero will be
* returned in the case of a timeout.
*/
ret = poll_teardown(fds, nfds, &count); ret = poll_teardown(fds, nfds, &count);
} }