[pulseaudio-commits] r2533 - /trunk/src/pulsecore/socket-client.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Jun 16 11:45:55 PDT 2008


Author: lennart
Date: Mon Jun 16 20:45:52 2008
New Revision: 2533

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2533&root=pulseaudio&view=rev
Log:
make use of the new pa_socket_address_is_local() function

Modified:
    trunk/src/pulsecore/socket-client.c

Modified: trunk/src/pulsecore/socket-client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/socket-client.c?rev=2533&root=pulseaudio&r1=2532&r2=2533&view=diff
==============================================================================
--- trunk/src/pulsecore/socket-client.c (original)
+++ trunk/src/pulsecore/socket-client.c Mon Jun 16 20:45:52 2008
@@ -61,6 +61,7 @@
 #include <pulsecore/core-error.h>
 #include <pulsecore/socket-util.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/socket-util.h>
 #include <pulsecore/log.h>
 #include <pulsecore/parseaddr.h>
 #include <pulsecore/macro.h>
@@ -270,22 +271,7 @@
     pa_assert(sa);
     pa_assert(salen);
 
-    switch (sa->sa_family) {
-        case AF_UNIX:
-            c->local = TRUE;
-            break;
-
-        case AF_INET:
-            c->local = ((const struct sockaddr_in*) sa)->sin_addr.s_addr == INADDR_LOOPBACK;
-            break;
-
-        case AF_INET6:
-            c->local = memcmp(&((const struct sockaddr_in6*) sa)->sin6_addr, &in6addr_loopback, sizeof(struct in6_addr)) == 0;
-            break;
-
-        default:
-            c->local = FALSE;
-    }
+    c->local = pa_socket_address_is_local(sa);
 
     if ((c->fd = socket(sa->sa_family, SOCK_STREAM, 0)) < 0) {
         pa_log("socket(): %s", pa_cstrerror(errno));




More information about the pulseaudio-commits mailing list