mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Handle the result of XSI-complint version of strerror_r correctly
This commit is contained in:
@ -160,7 +160,8 @@ int safe_strerror(
|
|||||||
|
|
||||||
// Handle the result of XSI-compliant version of strerror_r.
|
// Handle the result of XSI-compliant version of strerror_r.
|
||||||
int handle(int result) {
|
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.
|
// Handle the result of GNU-specific version of strerror_r.
|
||||||
|
Reference in New Issue
Block a user