diff options
author | David Troy <dave@popvox.com> | 2006-07-01 15:43:37 +0000 |
---|---|---|
committer | David Troy <dave@popvox.com> | 2006-07-01 15:43:37 +0000 |
commit | 5d52864609b3750bfeb7cda411802900aa190fc3 (patch) | |
tree | a7989cf5de2e99955310d8508582e6d19e8712d0 /src/poll.c | |
parent | 926f2742b7295cc83b2377535ebcaca2ad09936d (diff) | |
download | astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.tar.gz astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.tar.xz astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.zip |
Cleanup 1.21pre into 1.21 (release)
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/trunk@129 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src/poll.c')
-rw-r--r-- | src/poll.c | 76 |
1 files changed, 38 insertions, 38 deletions
@@ -72,12 +72,12 @@ \*---------------------------------------------------------------------------*/ #include <unistd.h> /* standard Unix definitions */ -#include <sys/types.h> /* system types */ -#include <sys/time.h> /* time definitions */ -#include <assert.h> /* assertion macros */ -#include <string.h> /* string functions */ +#include <sys/types.h> /* system types */ +#include <sys/time.h> /* time definitions */ +#include <assert.h> /* assertion macros */ +#include <string.h> /* string functions */ -#include "poll-compat.h" /* this package */ +#include "poll-compat.h" /* this package */ /*---------------------------------------------------------------------------*\ Macros @@ -96,21 +96,21 @@ static int map_poll_spec #if __STDC__ > 0 (struct pollfd *pArray, unsigned long n_fds, - fd_set *pReadSet, - fd_set *pWriteSet, - fd_set *pExceptSet) + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) #else (pArray, n_fds, pReadSet, pWriteSet, pExceptSet) struct pollfd *pArray; unsigned long n_fds; - fd_set *pReadSet; - fd_set *pWriteSet; - fd_set *pExceptSet; + fd_set *pReadSet; + fd_set *pWriteSet; + fd_set *pExceptSet; #endif { - register unsigned long i; /* loop control */ - register struct pollfd *pCur; /* current array element */ - register int max_fd = -1; /* return value */ + register unsigned long i; /* loop control */ + register struct pollfd *pCur; /* current array element */ + register int max_fd = -1; /* return value */ /* Map the poll() structures into the file descriptor sets required @@ -118,10 +118,10 @@ static int map_poll_spec */ for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) { - /* Skip any bad FDs in the array. */ + /* Skip any bad FDs in the array. */ - if (pCur->fd < 0) - continue; + if (pCur->fd < 0) + continue; if (pCur->events & POLLIN) { @@ -155,7 +155,7 @@ static struct timeval *map_timeout (int poll_timeout, struct timeval *pSelTimeout) #else (poll_timeout, pSelTimeout) - int poll_timeout; + int poll_timeout; struct timeval *pSelTimeout; #endif { @@ -168,7 +168,7 @@ static struct timeval *map_timeout VALUE MEANING -1 wait indefinitely (until signal occurs) - 0 return immediately, don't block + 0 return immediately, don't block >0 wait specified number of milliseconds select() uses a "struct timeval", which specifies the timeout in @@ -200,7 +200,7 @@ static struct timeval *map_timeout default: /* Wait the specified number of milliseconds. */ pSelTimeout->tv_sec = poll_timeout / 1000; /* get seconds */ - poll_timeout %= 1000; /* remove seconds */ + poll_timeout %= 1000; /* remove seconds */ pSelTimeout->tv_usec = poll_timeout * 1000; /* get microseconds */ pResult = pSelTimeout; break; @@ -214,27 +214,27 @@ static void map_select_results #if __STDC__ > 0 (struct pollfd *pArray, unsigned long n_fds, - fd_set *pReadSet, - fd_set *pWriteSet, - fd_set *pExceptSet) + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) #else (pArray, n_fds, pReadSet, pWriteSet, pExceptSet) struct pollfd *pArray; unsigned long n_fds; - fd_set *pReadSet; - fd_set *pWriteSet; - fd_set *pExceptSet; + fd_set *pReadSet; + fd_set *pWriteSet; + fd_set *pExceptSet; #endif { - register unsigned long i; /* loop control */ - register struct pollfd *pCur; /* current array element */ + register unsigned long i; /* loop control */ + register struct pollfd *pCur; /* current array element */ for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) { - /* Skip any bad FDs in the array. */ + /* Skip any bad FDs in the array. */ - if (pCur->fd < 0) - continue; + if (pCur->fd < 0) + continue; /* Exception events take priority over input events. */ @@ -268,13 +268,13 @@ int poll #endif { - fd_set read_descs; /* input file descs */ - fd_set write_descs; /* output file descs */ - fd_set except_descs; /* exception descs */ - struct timeval stime; /* select() timeout value */ - int ready_descriptors; /* function result */ - int max_fd; /* maximum fd value */ - struct timeval *pTimeout; /* actually passed */ + fd_set read_descs; /* input file descs */ + fd_set write_descs; /* output file descs */ + fd_set except_descs; /* exception descs */ + struct timeval stime; /* select() timeout value */ + int ready_descriptors; /* function result */ + int max_fd; /* maximum fd value */ + struct timeval *pTimeout; /* actually passed */ FD_ZERO (&read_descs); FD_ZERO (&write_descs); |