Commit 15683369 authored by Mark Andrews's avatar Mark Andrews
Browse files

namespace sun -> sunix

parent eaccf5e8
......@@ -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? */
......
......@@ -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
......
......@@ -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);
......
......@@ -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, '/');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment