]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/socket-client.c
Whitespace cleanup: Remove all multiple newlines
[pulseaudio] / src / pulsecore / socket-client.c
index ef3c29ee3e9a49f604e3cab4d19ad01b454b93c1..a12757a8d6c7e6c1f082fb3ec3e93afcad4ce6fc 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
 #ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
 #endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
@@ -56,9 +50,9 @@
 #include <pulse/timeval.h>
 #include <pulse/xmalloc.h>
 
-#include <pulsecore/winsock.h>
-#include <pulsecore/core-error.h>
+#include <pulsecore/socket.h>
 #include <pulsecore/socket-util.h>
+#include <pulsecore/core-error.h>
 #include <pulsecore/core-rtclock.h>
 #include <pulsecore/core-util.h>
 #include <pulsecore/socket-util.h>
@@ -66,6 +60,7 @@
 #include <pulsecore/parseaddr.h>
 #include <pulsecore/macro.h>
 #include <pulsecore/refcnt.h>
+#include <pulsecore/arpa-inet.h>
 
 #include "socket-client.h"
 
@@ -231,7 +226,6 @@ pa_socket_client* pa_socket_client_new_ipv4(pa_mainloop_api *m, uint32_t address
     return pa_socket_client_new_sockaddr(m, (struct sockaddr*) &sa, sizeof(sa));
 }
 
-
 pa_socket_client* pa_socket_client_new_unix(pa_mainloop_api *m, const char *filename) {
 #ifdef HAVE_SYS_UN_H
     struct sockaddr_un sa;
@@ -387,7 +381,8 @@ static void asyncns_cb(pa_mainloop_api*m, pa_io_event *e, int fd, pa_io_event_fl
         goto fail;
 
     if (res->ai_addr)
-        sockaddr_prepare(c, res->ai_addr, res->ai_addrlen);
+        if (sockaddr_prepare(c, res->ai_addr, res->ai_addrlen) < 0)
+            goto fail;
 
     asyncns_freeaddrinfo(res);
 
@@ -524,7 +519,7 @@ pa_socket_client* pa_socket_client_new_string(pa_mainloop_api *m, pa_bool_t use_
                 if (!host)
                     goto finish;
 
-                pa_zero(sa);
+                pa_zero(s);
                 s.sin_family = AF_INET;
                 memcpy(&s.sin_addr, host->h_addr, sizeof(struct in_addr));
                 s.sin_port = htons(a.port);