Loading...
--- Libc/Libc-320/sys/errno.c
+++ Libc/Libc-262.3.2/sys/errno.c
@@ -35,7 +35,7 @@
int *__error(void) {
pthread_t self = pthread_self();
/* If we're not a detached pthread, just return the global errno */
- if ((self == (pthread_t)0) || (self->sig != _PTHREAD_SIG)) {
+ if ((self == (pthread_t)0) || (self->sig != _PTHREAD_SIG) || (self->detached & _PTHREAD_CREATE_PARENT)) {
return &errno;
}
return &self->err_no;