From 8079d9fac385f0bd36b391d2f01d990648428eec Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 9 Jun 2021 15:58:16 +0900 Subject: [PATCH] Revert "TLS: Correct handling of returned error values." This reverts commit 9aaeaefa415a919d3228f5bb520c71dd412a1858. --- libs/libc/tls/tls_alloc.c | 5 +++-- libs/libc/tls/tls_free.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/libc/tls/tls_alloc.c b/libs/libc/tls/tls_alloc.c index ea170a16cc0..2630e7e415b 100644 --- a/libs/libc/tls/tls_alloc.c +++ b/libs/libc/tls/tls_alloc.c @@ -66,9 +66,10 @@ int tls_alloc(void) */ ret = _SEM_WAIT(&tinfo->ta_tlssem); - if (ret < 0) + + if (ERROR == ret) { - ret = _SEM_ERRVAL(ret); + ret = -get_errno(); goto errout_with_errno; } diff --git a/libs/libc/tls/tls_free.c b/libs/libc/tls/tls_free.c index 9cbe4a42387..7455e08cb33 100644 --- a/libs/libc/tls/tls_free.c +++ b/libs/libc/tls/tls_free.c @@ -79,7 +79,7 @@ int tls_free(int tlsindex) } else { - ret = _SEM_ERRVAL(ret); + ret = -get_errno(); } }