[libc-commits] [PATCH] D153572: [libc][NFC] Simplify return value logic in set_thread_ptr()

Jun Zhang via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 22 09:48:23 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGce378fcb9e1c: [libc][NFC] Simplify return value logic in set_thread_ptr() (authored by junaire).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153572/new/

https://reviews.llvm.org/D153572

Files:
  libc/startup/linux/x86_64/start.cpp


Index: libc/startup/linux/x86_64/start.cpp
===================================================================
--- libc/startup/linux/x86_64/start.cpp
+++ libc/startup/linux/x86_64/start.cpp
@@ -89,9 +89,7 @@
 
 // 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 **);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153572.533667.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230622/551d6312/attachment.bin>


More information about the libc-commits mailing list