diff options
Diffstat (limited to 'src/linux/tunDevice.cpp')
-rw-r--r-- | src/linux/tunDevice.cpp | 8 |
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); } |