summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-05-11 23:39:12 +0000
committerChristian Pointner <equinox@anytun.org>2008-05-11 23:39:12 +0000
commit4cdfe669de129ee2287d6fa7d4f9e170ca04ab2f (patch)
tree8bee684539b40cf2a14660eaab6493b60fcf11ce /src/linux
parentsame security fix for bsd device (diff)
fixed some thread safety bugs
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/tunDevice.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp
index 3c9e180..9f0ad52 100644
--- a/src/linux/tunDevice.cpp
+++ b/src/linux/tunDevice.cpp
@@ -49,7 +49,9 @@ 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("): ");
- msg.append(strerror(errno));
+ char buf[NL_TEXTMAX];
+ strerror_r(errno, buf, NL_TEXTMAX);
+ msg.append(buf);
throw std::runtime_error(msg);
}
@@ -76,7 +78,9 @@ 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: ");
- msg.append(strerror(errno));
+ char buf[NL_TEXTMAX];
+ strerror_r(errno, buf, NL_TEXTMAX);
+ msg.append(buf);
throw std::runtime_error(msg);
}