#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
#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>
#include <pulsecore/parseaddr.h>
#include <pulsecore/macro.h>
#include <pulsecore/refcnt.h>
+#include <pulsecore/arpa-inet.h>
#include "socket-client.h"
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;
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);
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);