fix strerror usage in uClibc version

This commit is contained in:
Radu Racariu 2018-03-05 09:40:49 +02:00
parent becfefbae9
commit bb3681fd14
2 changed files with 7 additions and 2 deletions

View file

@ -1536,10 +1536,13 @@ private bool isUnionAliasedImpl(T)(size_t offset)
static assert( isUnionAliased!(S.A5, 1)); //a5.b1;
}
version (CRuntime_Glibc) version = GNU_STRERROR;
version (CRuntime_UClibc) version = GNU_STRERROR;
package string errnoString(int errno) nothrow @trusted
{
import core.stdc.string : strlen;
version (CRuntime_Glibc)
version (GNU_STRERROR)
{
import core.stdc.string : strerror_r;
char[1024] buf = void;

View file

@ -146,6 +146,8 @@ class SocketException: Exception
mixin basicExceptionCtors;
}
version (CRuntime_Glibc) version = GNU_STRERROR;
version (CRuntime_UClibc) version = GNU_STRERROR;
/*
* Needs to be public so that SocketOSException can be thrown outside of
@ -159,7 +161,7 @@ string formatSocketError(int err) @trusted
{
char[80] buf;
const(char)* cs;
version (CRuntime_Glibc)
version (GNU_STRERROR)
{
cs = strerror_r(err, buf.ptr, buf.length);
}