Handle when the platform doesn't have UNIX sockets.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@377 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-01-05 18:43:10 +00:00
parent 3a3b4aff37
commit 13496bb73e
3 changed files with 47 additions and 3 deletions

View file

@ -31,10 +31,13 @@
#include <sys/socket.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef HAVE_LIBWRAP
#include <tcpd.h>
#endif
@ -137,6 +140,8 @@ struct pa_socket_server* pa_socket_server_ref(struct pa_socket_server *s) {
return s;
}
#ifdef HAVE_SYS_UN_H
struct pa_socket_server* pa_socket_server_new_unix(struct pa_mainloop_api *m, const char *filename) {
int fd = -1;
struct sockaddr_un sa;
@ -182,6 +187,14 @@ fail:
return NULL;
}
#else /* HAVE_SYS_UN_H */
struct pa_socket_server* pa_socket_server_new_unix(struct pa_mainloop_api *m, const char *filename) {
return NULL;
}
#endif /* HAVE_SYS_UN_H */
struct pa_socket_server* pa_socket_server_new_ipv4(struct pa_mainloop_api *m, uint32_t address, uint16_t port, const char *tcpwrap_service) {
struct pa_socket_server *ss;
int fd = -1;