summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-01-05 18:27:09 +0000
committerPierre Ossman <ossman@cendio.se>2006-01-05 18:27:09 +0000
commit3a3b4aff37397b786782d5a7e1f106b83d272abd (patch)
tree15e1490ebee57e1d6242c30e3f75cf969fc26d96
parentdbad54a20bf323d35176b1faba4fdd4b425f9ad9 (diff)
AF_UNIX and PF_UNIX is more portable than the _LOCAL equivalent.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@376 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--polyp/socket-client.c2
-rw-r--r--polyp/socket-server.c4
-rw-r--r--polyp/socket-util.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/polyp/socket-client.c b/polyp/socket-client.c
index 3cd3e946..2eecc347 100644
--- a/polyp/socket-client.c
+++ b/polyp/socket-client.c
@@ -203,7 +203,7 @@ struct pa_socket_client* pa_socket_client_new_unix(struct pa_mainloop_api *m, co
assert(m && filename);
memset(&sa, 0, sizeof(sa));
- sa.sun_family = AF_LOCAL;
+ sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, filename, sizeof(sa.sun_path)-1);
sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
diff --git a/polyp/socket-server.c b/polyp/socket-server.c
index 282f1eb0..7d6035c9 100644
--- a/polyp/socket-server.c
+++ b/polyp/socket-server.c
@@ -144,14 +144,14 @@ struct pa_socket_server* pa_socket_server_new_unix(struct pa_mainloop_api *m, co
assert(m && filename);
- if ((fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
pa_log(__FILE__": socket(): %s\n", strerror(errno));
goto fail;
}
pa_fd_set_cloexec(fd, 1);
- sa.sun_family = AF_LOCAL;
+ sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, filename, sizeof(sa.sun_path)-1);
sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
diff --git a/polyp/socket-util.c b/polyp/socket-util.c
index 7b32f4ee..cd132d7d 100644
--- a/polyp/socket-util.c
+++ b/polyp/socket-util.c
@@ -77,7 +77,7 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
ip & 0xFF,
ntohs(sa.in.sin_port));
return;
- } else if (sa.sa.sa_family == AF_LOCAL) {
+ } else if (sa.sa.sa_family == AF_UNIX) {
snprintf(c, l, "UNIX socket client");
return;
}
@@ -165,12 +165,12 @@ int pa_unix_socket_is_stale(const char *fn) {
struct sockaddr_un sa;
int fd = -1, ret = -1;
- if ((fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
pa_log(__FILE__": socket(): %s\n", strerror(errno));
goto finish;
}
- sa.sun_family = AF_LOCAL;
+ sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
sa.sun_path[sizeof(sa.sun_path) - 1] = 0;