mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Return the actual error code instead of a message when compiling to windows
This commit is contained in:
parent
032f0587f4
commit
d7734ca783
1 changed files with 5 additions and 0 deletions
|
@ -2547,7 +2547,12 @@ static void strerror_r_helper(int result, char* buf, size_t buflen)
|
|||
|
||||
void zeek_strerror_r(int zeek_errno, char* buf, size_t buflen)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
auto str = "Error number: " + std::to_string(zeek_errno);
|
||||
auto res = str.data();
|
||||
#else
|
||||
auto res = strerror_r(zeek_errno, buf, buflen);
|
||||
#endif
|
||||
// GNU vs. XSI flavors make it harder to use strerror_r.
|
||||
strerror_r_helper(res, buf, buflen);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue