Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
egecetin committed Oct 26, 2024
1 parent aa874a1 commit cffb162
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/utils/ErrorHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ extern std::vector<std::pair<std::string, std::shared_ptr<std::atomic_flag>>> vC
inline std::string getErrnoString(int errVal)
{
std::array<char, BUFSIZ> buffer{};
auto *val = strerror_r(errVal, buffer.data(), BUFSIZ);
#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE
int val = strerror_r(errVal, buffer.data(), BUFSIZ); // XSI-compliant version
if (val != 0)
{
return "Cannot get error message";
}
return buffer.data();
#else
return val;
return strerror_r(errVal, buffer.data(), BUFSIZ); // GNU-specific version
#endif
}

0 comments on commit cffb162

Please sign in to comment.