Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lavabit/magma.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLadar Levison <ladar@lavabit.com>2019-02-26 21:53:42 +0300
committerLadar Levison <ladar@lavabit.com>2019-02-26 21:53:42 +0300
commite10642c731224e1c008d49243661e49c121c4f32 (patch)
tree4d1d82cf74686f1267b9e181101128311fd2aea1 /src
parent93beb9c35a4bdc1331089270452efcefe73fe6f2 (diff)
Updated errno_string to handle Android builds.
Diffstat (limited to 'src')
-rw-r--r--src/core/host/errors.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/host/errors.c b/src/core/host/errors.c
index 1568e818..2456b711 100644
--- a/src/core/host/errors.c
+++ b/src/core/host/errors.c
@@ -297,12 +297,14 @@ chr_t * errno_name(int error) {
*/
chr_t * errno_string(int errnum, char *buf, size_t len) {
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
+#if defined(__USE_GNU) && __ANDROID_API__ >= 23
+ return __gnu_strerror_r(errnum, buf, len);
+#elif defined(__GLIBC__)
+ return strerror_r(errnum, buf, len);
+#else
int_t result = 0;
result = strerror_r(errnum, buf, len);
return (result == 0 ? buf : NULL);
-#else
- return strerror_r(errnum, buf, buflen);
#endif
}