summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-03-10 11:45:04 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-04-27 23:07:37 +0200
commit4efcdecebeb5e9464a0756b9a27325e427f8b573 (patch)
treeed8e90966de839224a4d7dfd77ad07a98a5c1e9a
parentca8927960700a5d15effe71352ed185c4af32499 (diff)
downloadopenvpn-4efcdecebeb5e9464a0756b9a27325e427f8b573.tar.gz
openvpn-4efcdecebeb5e9464a0756b9a27325e427f8b573.tar.xz
openvpn-4efcdecebeb5e9464a0756b9a27325e427f8b573.zip
On TARGET_LINUX define _GNU_SOURCE if not defined
This is to include peercred support on hosts where _GNU_SOURCE is not defined by default. This issue has been found on Gentoo with glibc-2.8. The solution was discussed on the IRC meeting March 4, 2010 in #openvpn-discussions. <http://thread.gmane.org/gmane.network.openvpn.devel/3242> Signed-off-by: David Sommerseth <dazo@users.sourceforge.net> Acked-by: James Yonan <james@openvpn.net>
-rw-r--r--syshead.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/syshead.h b/syshead.h
index 6e81103..fe6ae4b 100644
--- a/syshead.h
+++ b/syshead.h
@@ -85,6 +85,10 @@
#endif
#ifdef HAVE_SYS_SOCKET_H
+# if defined(TARGET_LINUX) && !defined(_GNU_SOURCE)
+ /* needed for peercred support on glibc-2.8 */
+# define _GNU_SOURCE
+# endif
#include <sys/socket.h>
#endif