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,7 +31,6 @@
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <unistd.h>
@ -42,6 +41,10 @@
#include <sys/stat.h>
#include <netdb.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#include "socket-util.h"
#include "util.h"
#include "xmalloc.h"
@ -161,6 +164,8 @@ int pa_socket_set_sndbuf(int fd, size_t l) {
return 0;
}
#ifdef HAVE_SYS_UN_H
int pa_unix_socket_is_stale(const char *fn) {
struct sockaddr_un sa;
int fd = -1, ret = -1;
@ -202,3 +207,15 @@ int pa_unix_socket_remove_stale(const char *fn) {
return 0;
}
#else /* HAVE_SYS_UN_H */
int pa_unix_socket_is_stale(const char *fn) {
return -1;
}
int pa_unix_socket_remove_stale(const char *fn) {
return -1;
}
#endif /* HAVE_SYS_UN_H */