Handle the result of XSI-complint version of strerror_r correctly

This commit is contained in:
vitaut 2015-03-14 14:05:02 -07:00
parent 341b98c6e2
commit e1776acd19

View File

@ -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.