From ce378fcb9e1c05460466a8aa46de818da6259a86 Mon Sep 17 00:00:00 2001 From: Jun Zhang Date: Fri, 23 Jun 2023 00:38:41 +0800 Subject: [PATCH] [libc][NFC] Simplify return value logic in set_thread_ptr() Signed-off-by: Jun Zhang Differential Revision: https://reviews.llvm.org/D153572 --- libc/startup/linux/x86_64/start.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libc/startup/linux/x86_64/start.cpp b/libc/startup/linux/x86_64/start.cpp index eece066..d4f2f49 100644 --- a/libc/startup/linux/x86_64/start.cpp +++ b/libc/startup/linux/x86_64/start.cpp @@ -89,9 +89,7 @@ void cleanup_tls(uintptr_t addr, uintptr_t size) { // Sets the thread pointer to |val|. Returns true on success, false on failure. static bool set_thread_ptr(uintptr_t val) { - return __llvm_libc::syscall_impl(SYS_arch_prctl, ARCH_SET_FS, val) == -1 - ? false - : true; + return __llvm_libc::syscall_impl(SYS_arch_prctl, ARCH_SET_FS, val) != -1; } using InitCallback = void(int, char **, char **); -- 2.7.4