void-packages/srcpkgs/motion/patches/musl-no-pthread_getname_np.patch
Jürgen Buchmüller 96739ecb7a motion: fix musl
2017-11-12 22:55:26 +01:00

30 lines
982 B
Diff

--- motion.c 2017-11-11 04:47:06.000000000 +0100
+++ motion.c 2017-11-12 22:49:59.866870114 +0100
@@ -3774,11 +3774,15 @@
#if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP) || defined(__APPLE__))
char currname[16];
+#if defined(__GLIBC__)
pthread_getname_np(pthread_self(), currname, sizeof(currname));
snprintf(threadname, sizeof(currname), "%s",currname);
#else
snprintf(threadname, 8, "%s","Unknown");
#endif
+#else
+ snprintf(threadname, 8, "%s","Unknown");
+#endif
}
int util_check_passthrough(struct context *cnt){
--- logger.c 2017-11-11 04:47:06.000000000 +0100
+++ logger.c 2017-11-12 22:53:58.717887149 +0100
@@ -207,7 +207,7 @@
errno_save = errno;
char threadname[32] = "unknown";
-#if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP) || defined(__APPLE__))
+#if ((!defined(BSD) && HAVE_PTHREAD_SETNAME_NP && defined(__GLIBC__)) || defined(__APPLE__))
pthread_getname_np(pthread_self(), threadname, sizeof(threadname));
#endif