From: Mark Andrews Date: Wed, 16 Mar 2005 23:39:06 +0000 (+0000) Subject: namespace sun -> sunix X-Git-Tag: v9.2.6b1~137^2~37 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=15683369e0113bd08863a705a8a1785c093455d3;p=thirdparty%2Fbind9.git namespace sun -> sunix --- diff --git a/lib/isc/include/isc/sockaddr.h b/lib/isc/include/isc/sockaddr.h index f26e711525e..a5dd7499ba4 100644 --- a/lib/isc/include/isc/sockaddr.h +++ b/lib/isc/include/isc/sockaddr.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.h,v 1.45 2005/02/24 00:33:34 marka Exp $ */ +/* $Id: sockaddr.h,v 1.46 2005/03/16 23:39:06 marka Exp $ */ #ifndef ISC_SOCKADDR_H #define ISC_SOCKADDR_H 1 @@ -33,7 +33,7 @@ struct isc_sockaddr { struct sockaddr_in sin; struct sockaddr_in6 sin6; #ifdef ISC_PLATFORM_HAVESYSUNH - struct sockaddr_un sun; + struct sockaddr_un sunix; #endif } type; unsigned int length; /* XXXRTH beginning? */ diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c index c57ca4d38c3..99f7a2f3342 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.c,v 1.33 2005/03/16 20:15:08 marka Exp $ */ +/* $Id: netaddr.c,v 1.34 2005/03/16 23:39:05 marka Exp $ */ #include @@ -349,7 +349,7 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) { break; #ifdef ISC_PLATFORM_HAVESYSUNH case AF_UNIX: - memcpy(t->type.un, s->type.sun.sun_path, sizeof(t->type.un)); + memcpy(t->type.un, s->type.sunix.sun_path, sizeof(t->type.un)); t->zone = 0; break; #endif diff --git a/lib/isc/sockaddr.c b/lib/isc/sockaddr.c index 3bffb6128ae..51e24f8002d 100644 --- a/lib/isc/sockaddr.c +++ b/lib/isc/sockaddr.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.c,v 1.63 2005/02/24 00:33:33 marka Exp $ */ +/* $Id: sockaddr.c,v 1.64 2005/03/16 23:39:05 marka Exp $ */ #include @@ -132,11 +132,11 @@ isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target) { break; #ifdef ISC_PLAFORM_HAVESYSUNH case AF_UNIX: - plen = strlen(sockaddr->type.sun.sun_path); + plen = strlen(sockaddr->type.sunix.sun_path); if (plen >= isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); - isc_buffer_putmem(target, sockaddr->type.sun.sun_path, plen); + isc_buffer_putmem(target, sockaddr->type.sunix.sun_path, plen); /* * Null terminate after used region. @@ -482,15 +482,15 @@ isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) { isc_result_t isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path) { #ifdef ISC_PLATFORM_HAVESYSUNH - if (strlen(path) >= sizeof(sockaddr->type.sun.sun_path)) + if (strlen(path) >= sizeof(sockaddr->type.sunix.sun_path)) return (ISC_R_NOSPACE); memset(sockaddr, 0, sizeof(*sockaddr)); - sockaddr->length = sizeof(sockaddr->type.sun); - sockaddr->type.sun.sun_family = AF_UNIX; + sockaddr->length = sizeof(sockaddr->type.sunix); + sockaddr->type.sunix.sun_family = AF_UNIX; #ifdef ISC_PLATFORM_HAVESALEN - sockaddr->type.sun.sun_len = sizeof(sockaddr->type.sun); + sockaddr->type.sunix.sun_len = sizeof(sockaddr->type.sunix); #endif - strcpy(sockaddr->type.sun.sun_path, path); + strcpy(sockaddr->type.sunix.sun_path, path); return (ISC_R_SUCCESS); #else UNUSED(sockaddr); diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 6f8eb5f08bc..7cf8cba54a9 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.246 2005/03/15 01:41:28 marka Exp $ */ +/* $Id: socket.c,v 1.247 2005/03/16 23:39:06 marka Exp $ */ #include @@ -2891,27 +2891,27 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { #endif if (active) { - if (stat(sockaddr->type.sun.sun_path, &sb) < 0) { + if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: stat(%s): %s", - sockaddr->type.sun.sun_path, strbuf); + sockaddr->type.sunix.sun_path, strbuf); return; } if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: %s: not a socket", - sockaddr->type.sun.sun_path); + sockaddr->type.sunix.sun_path); return; } - if (unlink(sockaddr->type.sun.sun_path) < 0) { + if (unlink(sockaddr->type.sunix.sun_path) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: unlink(%s): %s", - sockaddr->type.sun.sun_path, strbuf); + sockaddr->type.sunix.sun_path, strbuf); } return; } @@ -2922,11 +2922,11 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: socket(%s): %s", - sockaddr->type.sun.sun_path, strbuf); + sockaddr->type.sunix.sun_path, strbuf); return; } - if (stat(sockaddr->type.sun.sun_path, &sb) < 0) { + if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { switch (errno) { case ENOENT: /* We exited cleanly last time */ break; @@ -2935,7 +2935,7 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: stat(%s): %s", - sockaddr->type.sun.sun_path, strbuf); + sockaddr->type.sunix.sun_path, strbuf); break; } goto cleanup; @@ -2945,23 +2945,23 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: %s: not a socket", - sockaddr->type.sun.sun_path); + sockaddr->type.sunix.sun_path); goto cleanup; } - if (connect(s, (struct sockaddr *)&sockaddr->type.sun, - sizeof(sockaddr->type.sun)) < 0) { + if (connect(s, (struct sockaddr *)&sockaddr->type.sunix, + sizeof(sockaddr->type.sunix)) < 0) { switch (errno) { case ECONNREFUSED: case ECONNRESET: - if (unlink(sockaddr->type.sun.sun_path) < 0) { + if (unlink(sockaddr->type.sunix.sun_path) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: " "unlink(%s): %s", - sockaddr->type.sun.sun_path, + sockaddr->type.sunix.sun_path, strbuf); } break; @@ -2970,7 +2970,7 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: connect(%s): %s", - sockaddr->type.sun.sun_path, strbuf); + sockaddr->type.sunix.sun_path, strbuf); break; } } @@ -2989,14 +2989,14 @@ isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, #ifdef ISC_PLATFORM_HAVESYSUNH isc_result_t result = ISC_R_SUCCESS; char strbuf[ISC_STRERRORSIZE]; - char path[sizeof(sockaddr->type.sun.sun_path)]; + char path[sizeof(sockaddr->type.sunix.sun_path)]; #ifdef NEED_SECURE_DIRECTORY char *slash; #endif REQUIRE(sockaddr->type.sa.sa_family == AF_UNIX); - INSIST(strlen(sockaddr->type.sun.sun_path) < sizeof(path)); - strcpy(path, sockaddr->type.sun.sun_path); + INSIST(strlen(sockaddr->type.sunix.sun_path) < sizeof(path)); + strcpy(path, sockaddr->type.sunix.sun_path); #ifdef NEED_SECURE_DIRECTORY slash = strrchr(path, '/');