From 63ccf8199f8a6507f0e9616adccbae3e1a74a5ed Mon Sep 17 00:00:00 2001 From: Sergey Lyubka <valenok@gmail.com> Date: Mon, 13 May 2013 18:07:38 +0100 Subject: [PATCH] Style changes in poll() --- mongoose.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mongoose.c b/mongoose.c index c67c8d954..bb5b43e48 100644 --- a/mongoose.c +++ b/mongoose.c @@ -187,7 +187,7 @@ typedef struct DIR { struct dirent result; } DIR; -#ifndef HAS_POLL +#ifndef HAVE_POLL struct pollfd { int fd; short events; @@ -1222,8 +1222,7 @@ static struct dirent *readdir(DIR *dir) { static int poll(struct pollfd *pfd, int n, int milliseconds) { struct timeval tv; fd_set set; - int i, result; - int maxfd = 0; + int i, result, maxfd = 0; tv.tv_sec = milliseconds / 1000; tv.tv_usec = (milliseconds % 1000) * 1000; @@ -1238,7 +1237,7 @@ static int poll(struct pollfd *pfd, int n, int milliseconds) { } } - if ((result = select(maxfd+1, &set, NULL, NULL, &tv)) > 0) { + if ((result = select(maxfd + 1, &set, NULL, NULL, &tv)) > 0) { for (i = 0; i < n; i++) { if (FD_ISSET(pfd[i].fd, &set)) { pfd[i].revents = POLLIN; -- GitLab