summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-18 14:59:59 +1000
committerDamien Miller <djm@mindrot.org>2000-08-18 14:59:59 +1000
commit3241fa15eab83af79bfda709ffe6d235705d614d (patch)
tree0892a8bb67145e2945a55e5ac5cedc52ee9f7867
parenta7f58293f7340fc022c025b482614d5bd8dada50 (diff)
- (djm) SUN_LEN macro for systems which lack it
-rw-r--r--ChangeLog1
-rw-r--r--defines.h6
-rw-r--r--includes.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fd41fa6..ae8ae56e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,7 @@
Charles Levert <charles@comm.polymtl.ca>
- (djm) Seperate arc4random into seperate file and use OpenSSL's RC4
implementation.
+ - (djm) SUN_LEN macro for systems which lack it
20000815
- (djm) More SunOS 4.1.x fixes from Nate Itkin <nitkin@europa.com>
diff --git a/defines.h b/defines.h
index 0480006d..cd322f9b 100644
--- a/defines.h
+++ b/defines.h
@@ -6,6 +6,7 @@
#include <sys/types.h> /* For [u]intxx_t */
#include <sys/socket.h> /* For SHUT_XXXX */
#include <sys/param.h> /* For MAXPATHLEN */
+#include <sys/un.h> /* For SUN_LEN */
#include <netinet/in_systm.h> /* For typedefs */
#include <netinet/in.h> /* For IPv6 macros */
#include <netinet/ip.h> /* For IPTOS macros */
@@ -282,6 +283,11 @@ typedef int mode_t;
# define USE_PAM
#endif /* defined(HAVE_SECURITY_PAM_APPL_H) && !defined(DISABLE_PAM) */
+#ifndef SUN_LEN
+#define SUN_LEN(su) \
+ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif /* SUN_LEN */
+
/* Function replacement / compatibility hacks */
/* In older versions of libpam, pam_strerror takes a single argument */
diff --git a/includes.h b/includes.h
index 13042fd2..5102c97a 100644
--- a/includes.h
+++ b/includes.h
@@ -27,7 +27,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
-#include <sys/un.h>
#include <sys/resource.h>
#include <netinet/tcp.h>