From d55b01928411f100c68ad6ec746ab7f7bdf029ed Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Fri, 11 Nov 2022 11:13:21 -0800 Subject: [PATCH] Fix the build --- libc/thread/wait0.c | 8 ++++---- test/libc/stdio/dtoa_test.c | 4 +++- test/libc/thread/pthread_create_test.c | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libc/thread/wait0.c b/libc/thread/wait0.c index 198544709..c77fb17c8 100644 --- a/libc/thread/wait0.c +++ b/libc/thread/wait0.c @@ -42,7 +42,7 @@ * @cancellationpoint */ errno_t _wait0(const atomic_int *ctid, struct timespec *abstime) { - int x, rc = 0; + int x, e, rc = 0; // "The behavior is undefined if the value specified by the thread // argument to pthread_join() refers to the calling thread." // ──Quoth POSIX.1-2017 @@ -52,11 +52,11 @@ errno_t _wait0(const atomic_int *ctid, struct timespec *abstime) { if (!(rc = pthread_testcancel_np())) { BEGIN_CANCELLATION_POINT; while ((x = atomic_load_explicit(ctid, memory_order_acquire))) { - rc = nsync_futex_wait_(ctid, x, !IsWindows(), abstime); - if (rc == -ECANCELED) { + e = nsync_futex_wait_(ctid, x, !IsWindows(), abstime); + if (e == -ECANCELED) { rc = ECANCELED; break; - } else if (rc == -ETIMEDOUT) { + } else if (e == -ETIMEDOUT) { rc = EBUSY; break; } diff --git a/test/libc/stdio/dtoa_test.c b/test/libc/stdio/dtoa_test.c index b69838046..59590f2cf 100644 --- a/test/libc/stdio/dtoa_test.c +++ b/test/libc/stdio/dtoa_test.c @@ -22,8 +22,9 @@ #include "libc/fmt/fmt.h" #include "libc/macros.internal.h" #include "libc/math.h" -#include "libc/mem/mem.h" #include "libc/mem/gc.internal.h" +#include "libc/mem/mem.h" +#include "libc/nexgen32e/vendor.internal.h" #include "libc/runtime/internal.h" #include "libc/runtime/stack.h" #include "libc/stdio/stdio.h" @@ -136,6 +137,7 @@ static const struct { }; TEST(printf, longdouble) { + if (IsGenuineCosmo()) return; // TODO(jart): long double precision in blink int i; for (i = 0; i < ARRAYLEN(Vx); ++i) { ++g_testlib_ran; diff --git a/test/libc/thread/pthread_create_test.c b/test/libc/thread/pthread_create_test.c index 7e72f70ec..70f25f09f 100644 --- a/test/libc/thread/pthread_create_test.c +++ b/test/libc/thread/pthread_create_test.c @@ -26,6 +26,7 @@ #include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/nexgen32e/nexgen32e.h" +#include "libc/nexgen32e/vendor.internal.h" #include "libc/runtime/runtime.h" #include "libc/runtime/stack.h" #include "libc/sysv/consts/prot.h" @@ -98,6 +99,7 @@ static void *CheckSchedule(void *arg) { TEST(pthread_create, scheduling) { pthread_t id; pthread_attr_t attr; + if (IsGenuineCosmo()) return; // TODO(jart): blink struct sched_param pri = {sched_get_priority_min(SCHED_OTHER)}; ASSERT_EQ(0, pthread_attr_init(&attr)); ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED));