mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 20:18:49 +00:00
Handle the result of XSI-complint version of strerror_r correctly
This commit is contained in:
parent
341b98c6e2
commit
e1776acd19
@ -160,7 +160,8 @@ int safe_strerror(
|
||||
|
||||
// Handle the result of XSI-compliant version of strerror_r.
|
||||
int handle(int result) {
|
||||
return result != 0 ? errno : result;
|
||||
// glibc versions before 2.13 return result in errno.
|
||||
return result == -1 ? errno : result;
|
||||
}
|
||||
|
||||
// Handle the result of GNU-specific version of strerror_r.
|
||||
|
Loading…
Reference in New Issue
Block a user