summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-05-09 20:16:36 +0000
committerArthur de Jong <arthur@arthurdejong.org>2012-05-09 20:16:36 +0000
commitddde9ba4a0d28452aeb5bf6e76b5e71f6b417701 (patch)
treebb53ebcf8126d4611fd9f6aab02f35b97a1934ca /compat
parent5620ad1de39b381cb8a64b1e2b0d8d3e28633e68 (diff)
provide a compatibility definition of SUN_LEN() for systems that lack it
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1686 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'compat')
-rw-r--r--compat/Makefile.am4
-rw-r--r--compat/nss_compat.h2
-rw-r--r--compat/socket.h34
3 files changed, 37 insertions, 3 deletions
diff --git a/compat/Makefile.am b/compat/Makefile.am
index 9ff1204..07b5d80 100644
--- a/compat/Makefile.am
+++ b/compat/Makefile.am
@@ -1,6 +1,6 @@
# Makefile.am - use automake to generate Makefile.in
#
-# Copyright (C) 2008, 2009, 2010, 2011 Arthur de Jong
+# Copyright (C) 2008, 2009, 2010, 2011, 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,7 @@ EXTRA_DIST = getopt_long.c getopt_long.h \
daemon.c daemon.h \
ether.c ether.h \
strndup.c strndup.h \
- nss_compat.h \
+ nss_compat.h socket.h \
ldap_compat.h pagectrl.c ldap_passwd_s.c ldap_initialize.c \
pam_compat.h pam_get_authtok.c pam_prompt.c
diff --git a/compat/nss_compat.h b/compat/nss_compat.h
index 232519e..74bb979 100644
--- a/compat/nss_compat.h
+++ b/compat/nss_compat.h
@@ -21,7 +21,7 @@
*/
#ifndef COMPAT__NSS_H
-#define COMPAT__NSS_H
+#define COMPAT__NSS_H 1
#ifdef HAVE_NSS_H
#include <nss.h>
diff --git a/compat/socket.h b/compat/socket.h
new file mode 100644
index 0000000..84eaf91
--- /dev/null
+++ b/compat/socket.h
@@ -0,0 +1,34 @@
+/*
+ socket.h - compatibility hacks for socket functions
+
+ Copyright (C) 2012 Arthur de Jong
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+*/
+
+#ifndef COMPAT__SOCKET_H
+#define COMPAT__SOCKET_H 1
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* provide a definition for SUN_LEN for systems without it */
+#ifndef SUN_LEN
+#define SUN_LEN(addr) (sizeof((addr).sun_family)+strlen((addr).sun_path)+1)
+#endif /* not SUN_LEN */
+
+#endif /* not COMPAT__SOCKET_H */