Loading...
--- Libc/Libc-763.13/sys/errno.c
+++ Libc/Libc-262.2.12/sys/errno.c
@@ -2,6 +2,8 @@
  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
@@ -33,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;