aboutsummaryrefslogtreecommitdiff
path: root/lib/poll-loop.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-11-22 11:05:53 -0800
committerBen Pfaff <blp@nicira.com>2011-11-28 09:19:48 -0800
commit3907401ce6c5a848797507fcd6bc97218d4847e2 (patch)
treea4f862280f9d8ac702d475adb42b5f169a73e49e /lib/poll-loop.c
parentf6d1465cec98fd7e83845d24fb394145bbbcf531 (diff)
Revert "poll-loop: Enable checking whether a FD caused a wakeup."
This reverts commit 1e276d1a10539a8cd97d2ad63c073a9a43f0f1ef. The poll_fd_woke() and nl_sock_woke() function added in that commit are no longer used, so there is no reason to keep them in the tree.
Diffstat (limited to 'lib/poll-loop.c')
-rw-r--r--lib/poll-loop.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/lib/poll-loop.c b/lib/poll-loop.c
index de080b4c..5ff70d9f 100644
--- a/lib/poll-loop.c
+++ b/lib/poll-loop.c
@@ -62,15 +62,6 @@ static int timeout = -1;
/* Location where waiter created. */
static const char *timeout_where;
-/* Array of file descriptors from last run of poll_block(). */
-static struct pollfd *pollfds;
-
-/* Allocated size of pollfds. */
-static size_t max_pollfds;
-
-/* Current number of elements in pollfds. */
-static int n_pollfds;
-
static struct poll_waiter *new_waiter(int fd, short int events,
const char *where);
@@ -219,8 +210,11 @@ log_wakeup(const char *where, const struct pollfd *pollfd, int timeout)
void
poll_block(void)
{
+ static struct pollfd *pollfds;
+ static size_t max_pollfds;
+
struct poll_waiter *pw, *next;
- int n_waiters;
+ int n_waiters, n_pollfds;
int retval;
/* Register fatal signal events before actually doing any real work for
@@ -281,25 +275,6 @@ poll_cancel(struct poll_waiter *pw)
free(pw);
}
}
-
-/* Checks whether the given file descriptor caused the poll loop to wake up
- * in the previous iteration. If it did, returns a bitmask of the events
- * that caused the wakeup. Otherwise returns 0;
- */
-short int
-poll_fd_woke(int fd)
-{
- int i;
- short int events = 0;
-
- for (i = 0; i < n_pollfds; i++) {
- if (pollfds[i].fd == fd) {
- events |= pollfds[i].revents;
- }
- }
-
- return events;
-}
/* Creates and returns a new poll_waiter for 'fd' and 'events'. */
static struct poll_waiter *