logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: 583d84863c517f3a0ccd25b84dd195f9f14cefed
parent 03ff506c35e0aeaa208e38b9e98991dc869ab017
Author: Michael Forney <mforney@mforney.org>
Date:   Thu,  8 Jul 2021 16:50:02 -0700

musl: Add pthread_getname_np.c to sources

03ff506c added the source file but didn't add it to base.lua, so
it did not get built.

Also, update the patch to fix the error check.

Diffstat:

Mpkg/musl/base.lua1+
Mpkg/musl/patch/0002-add-pthread_getname_np-function.patch6+++---
Mpkg/musl/ver2+-
3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pkg/musl/base.lua b/pkg/musl/base.lua @@ -1145,6 +1145,7 @@ return { 'src/thread/pthread_getattr_np.c', 'src/thread/pthread_getconcurrency.c', 'src/thread/pthread_getcpuclockid.c', + 'src/thread/pthread_getname_np.c', 'src/thread/pthread_getschedparam.c', 'src/thread/pthread_getspecific.c', 'src/thread/pthread_join.c', diff --git a/pkg/musl/patch/0002-add-pthread_getname_np-function.patch b/pkg/musl/patch/0002-add-pthread_getname_np-function.patch @@ -1,4 +1,4 @@ -From ffc49274d11cd77d0b6f92f6581f70e58871d370 Mon Sep 17 00:00:00 2001 +From 88632ac04b21a909df28f71ac325ce4bc0a80ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org> Date: Tue, 20 Apr 2021 16:15:15 -0300 Subject: [PATCH] add pthread_getname_np function @@ -24,7 +24,7 @@ index 0492f26a..89fd9ff7 100644 int pthread_tryjoin_np(pthread_t, void **); diff --git a/src/thread/pthread_getname_np.c b/src/thread/pthread_getname_np.c new file mode 100644 -index 00000000..48d1a294 +index 00000000..85504e45 --- /dev/null +++ b/src/thread/pthread_getname_np.c @@ -0,0 +1,25 @@ @@ -47,7 +47,7 @@ index 00000000..48d1a294 + + snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); -+ if ((fd = open(f, O_RDONLY|O_CLOEXEC)) < 0 || (len = read(fd, name, len)) < 0) status = errno; ++ if ((fd = open(f, O_RDONLY|O_CLOEXEC)) < 0 || (len = read(fd, name, len)) == -1) status = errno; + else name[len-1] = 0; /* remove trailing new line only if successful */ + if (fd >= 0) close(fd); + pthread_setcancelstate(cs, 0); diff --git a/pkg/musl/ver b/pkg/musl/ver @@ -1 +1 @@ -1.2.2 r2 +1.2.2 r3