You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mt...@apache.org on 2009/02/20 12:02:54 UTC

svn commit: r746202 - /apr/apr/trunk/network_io/unix/sockaddr.c

Author: mturk
Date: Fri Feb 20 11:02:54 2009
New Revision: 746202

URL: http://svn.apache.org/viewvc?rev=746202&view=rev
Log:
If APR_UNIX given explicitly do not check if the hostname starts with '/'
Strdup when returning our hostname.
Thanks Ruediger

Modified:
    apr/apr/trunk/network_io/unix/sockaddr.c

Modified: apr/apr/trunk/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockaddr.c?rev=746202&r1=746201&r2=746202&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockaddr.c (original)
+++ apr/apr/trunk/network_io/unix/sockaddr.c Fri Feb 20 11:02:54 2009
@@ -580,7 +580,7 @@
         family = APR_UNIX;
     if (family == APR_UNIX) {
 #if APR_HAVE_SOCKADDR_UN
-        if (hostname && *hostname == '/') {
+        if (hostname) {
             *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
             (*sa)->pool = p;
             apr_cpystrn((*sa)->sa.unx.sun_path, hostname,
@@ -656,7 +656,7 @@
     }
 #if APR_HAVE_SOCKADDR_UN
     else if (sockaddr->family == APR_UNIX) {
-        *hostname = sockaddr->hostname;
+        *hostname = apr_pstrdup(sockaddr->pool, sockaddr->hostname);
         return APR_SUCCESS;
     }
 #endif