]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
namespace sun -> sunix
authorMark Andrews <marka@isc.org>
Wed, 16 Mar 2005 23:39:06 +0000 (23:39 +0000)
committerMark Andrews <marka@isc.org>
Wed, 16 Mar 2005 23:39:06 +0000 (23:39 +0000)
lib/isc/include/isc/sockaddr.h
lib/isc/netaddr.c
lib/isc/sockaddr.c
lib/isc/unix/socket.c

index f26e711525e2f5b7ea723d2615fc0f9032b44375..a5dd7499ba4cdf1fe9b238f6f2d542ae73ff3d17 100644 (file)
@@ -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? */
index c57ca4d38c3f0e9cd037db4acc9a7afc990459e7..99f7a2f3342bffcb99a43a0d7a3be45fc234ace9 100644 (file)
@@ -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 <config.h>
 
@@ -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
index 3bffb6128ae6869da3291006c69a829f340390d2..51e24f8002d3928c4b894b5dc3cb2dcc7edca62d 100644 (file)
@@ -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 <config.h>
 
@@ -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);
index 6f8eb5f08bca3566fdde9f61d99996890b14830c..7cf8cba54a92b5f878fd09a3a570ce8967e239c5 100644 (file)
@@ -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 <config.h>
 
@@ -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, '/');