]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
On TARGET_LINUX define _GNU_SOURCE if not defined
authorDavid Sommerseth <dazo@users.sourceforge.net>
Wed, 10 Mar 2010 10:45:04 +0000 (11:45 +0100)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Thu, 29 Apr 2010 18:22:09 +0000 (20:22 +0200)
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>
syshead.h

index bc54ce0e4d9d187ee7e6d0c16f1066fdbf846860..0a3eb143f1442c789d9d7f88c1015f3b7e6460c9 100644 (file)
--- a/syshead.h
+++ b/syshead.h
 #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