diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/pthreads/fix-pthread_getname_np.patch | |
Diffstat (limited to 'vcpkg/ports/pthreads/fix-pthread_getname_np.patch')
| -rw-r--r-- | vcpkg/ports/pthreads/fix-pthread_getname_np.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vcpkg/ports/pthreads/fix-pthread_getname_np.patch b/vcpkg/ports/pthreads/fix-pthread_getname_np.patch new file mode 100644 index 0000000..7eaadea --- /dev/null +++ b/vcpkg/ports/pthreads/fix-pthread_getname_np.patch @@ -0,0 +1,26 @@ +diff --git a/pthread_getname_np.c b/pthread_getname_np.c +index 8fc32b1..7c18655 100644 +--- a/pthread_getname_np.c ++++ b/pthread_getname_np.c +@@ -59,10 +59,18 @@ pthread_getname_np(pthread_t thr, char *name, int len) + + __ptw32_mcs_lock_acquire (&tp->threadLock, &threadLock); + +- for (s = tp->name, d = name; *s && d < &name[len - 1]; *d++ = *s++) +- {} ++ if(tp->name) ++ { ++ for (s = tp->name, d = name; *s && d < &name[len - 1]; *d++ = *s++) ++ {} ++ ++ *d = '\0'; ++ } ++ else ++ { ++ *name = '\0'; ++ } + +- *d = '\0'; + __ptw32_mcs_lock_release (&threadLock); + + return result; |