summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-16 18:55:20 +0000
committerLennart Poettering <lennart@poettering.net>2008-06-16 18:55:20 +0000
commitf4e27509777767c3d21e041005fec85d7807dedf (patch)
treec734a6e3422b6729ea30454bb343c1f290efc57b /src
parent3b691c25a1f5925f124cd5f768f6661843585c1b (diff)
add new function pa_iochannel_socket_is_local()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2534 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/iochannel.c13
-rw-r--r--src/pulsecore/iochannel.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
index 63ab2ad7..717bc38c 100644
--- a/src/pulsecore/iochannel.c
+++ b/src/pulsecore/iochannel.c
@@ -424,3 +424,16 @@ int pa_iochannel_get_send_fd(pa_iochannel *io) {
return io->ofd;
}
+
+pa_bool_t pa_iochannel_socket_is_local(pa_iochannel *io) {
+ pa_assert(io);
+
+ if (pa_socket_is_local(io->ifd))
+ return TRUE;
+
+ if (io->ifd != io->ofd)
+ if (pa_socket_is_local(io->ofd))
+ return TRUE;
+
+ return FALSE;
+}
diff --git a/src/pulsecore/iochannel.h b/src/pulsecore/iochannel.h
index c9794d99..8e8b8ce9 100644
--- a/src/pulsecore/iochannel.h
+++ b/src/pulsecore/iochannel.h
@@ -85,6 +85,8 @@ void pa_iochannel_socket_peer_to_string(pa_iochannel*io, char*s, size_t l);
int pa_iochannel_socket_set_rcvbuf(pa_iochannel*io, size_t l);
int pa_iochannel_socket_set_sndbuf(pa_iochannel*io, size_t l);
+pa_bool_t pa_iochannel_socket_is_local(pa_iochannel *io);
+
pa_mainloop_api* pa_iochannel_get_mainloop_api(pa_iochannel *io);
int pa_iochannel_get_recv_fd(pa_iochannel *io);