]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/poll.c
Fix up according to Coding Style
[pulseaudio] / src / pulsecore / poll.c
index b98fb1697af405d57c8906a763488f62caae6a21..df4feb0117d8ffbc0eee1673b96455b832b3c53f 100644 (file)
@@ -45,8 +45,7 @@
 #include <sys/select.h>
 #endif
 
-#include "winsock.h"
-
+#include <pulsecore/socket.h>
 #include <pulsecore/core-util.h>
 #include <pulse/util.h>
 
@@ -106,7 +105,7 @@ int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
     tv.tv_sec = timeout / 1000;
     tv.tv_usec = (timeout % 1000) * 1000;
 
-    ready = select ((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
+    ready = select((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
                     SELECT_TYPE_ARG234 &wset, SELECT_TYPE_ARG234 &xset,
                     SELECT_TYPE_ARG5 (timeout == -1 ? NULL : &tv));
 
@@ -161,7 +160,7 @@ int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
         /* Linux alters the tv struct... but it shouldn't matter here ...
          * as we're going to be a little bit out anyway as we've just eaten
          * more than a couple of cpu cycles above */
-            ready = select ((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
+            ready = select((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
                             SELECT_TYPE_ARG234 &wset, SELECT_TYPE_ARG234 &xset,
                             SELECT_TYPE_ARG5 (timeout == -1 ? NULL : &tv));
         }
@@ -187,11 +186,11 @@ int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
                      * connected socket, a server socket, or something else using a
                      * 0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                     r = recv(f->fd, NULL, 0, MSG_PEEK);
-                   if (r == 0 || (r < 0 && errno == ENOTSOCK))
-                       ioctl(f->fd, FIONREAD, &r);
+                    if (r == 0 || (r < 0 && errno == ENOTSOCK))
+                        ioctl(f->fd, FIONREAD, &r);
 
-                   if (r == 0)
-                       f->revents |= POLLHUP;
+                    if (r == 0)
+                        f->revents |= POLLHUP;
 #else /* !OS_IS_DARWIN */
                     if (recv (f->fd, data, 64, MSG_PEEK) == -1) {
                         if (errno == ESHUTDOWN || errno == ECONNRESET ||