From c38f0e21deb427802f4be2d4994903ae906ebbf2 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 12 May 2008 21:30:22 +0000 Subject: fixed build on linux --- src/linux/tunDevice.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/linux/tunDevice.cpp') diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp index 1882a93..a226641 100644 --- a/src/linux/tunDevice.cpp +++ b/src/linux/tunDevice.cpp @@ -28,6 +28,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define _XOPEN_SOURCE 600 +#include +#include + #include #include #include @@ -38,8 +42,6 @@ #include #define DEFAULT_DEVICE "/dev/net/tun" -#include - #include "tunDevice.h" #include "threadUtils.hpp" @@ -51,8 +53,8 @@ TunDevice::TunDevice(const char* dev_name, const char* dev_type, const char* ifc std::string msg("can't open device file ("); msg.append(DEFAULT_DEVICE); msg.append("): "); - char buf[NL_TEXTMAX]; - strerror_r(errno, buf, NL_TEXTMAX); + char buf[STERROR_TEXT_MAX]; + strerror_r(errno, buf, STERROR_TEXT_MAX); msg.append(buf); throw std::runtime_error(msg); } @@ -80,8 +82,8 @@ TunDevice::TunDevice(const char* dev_name, const char* dev_type, const char* ifc actual_name_ = ifr.ifr_name; } else { std::string msg("tun/tap device ioctl failed: "); - char buf[NL_TEXTMAX]; - strerror_r(errno, buf, NL_TEXTMAX); + char buf[STERROR_TEXT_MAX]; + strerror_r(errno, buf, STERROR_TEXT_MAX); msg.append(buf); throw std::runtime_error(msg); } -- cgit v1.2.3