| 101 | |
| 102 | namespace { |
| 103 | std::string errorMsg(int errNum) |
| 104 | { |
| 105 | #ifndef __MINGW32__ |
| 106 | return util::safeStrerror(errNum); |
| 107 | #else |
| 108 | auto msg = util::formatLastError(errNum); |
| 109 | if (msg.empty()) { |
| 110 | char buf[256]; |
| 111 | snprintf(buf, sizeof(buf), EX_SOCKET_UNKNOWN_ERROR, errNum, errNum); |
| 112 | return buf; |
| 113 | } |
| 114 | return msg; |
| 115 | #endif // __MINGW32__ |
| 116 | } |
| 117 | } // namespace |
| 118 | |
| 119 | namespace { |
no test coverage detected