[BZ #5245]
authorUlrich Drepper <drepper@redhat.com>
Thu, 8 Nov 2007 17:24:34 +0000 (17:24 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 8 Nov 2007 17:24:34 +0000 (17:24 +0000)
2007-11-08  Ulrich Drepper  <drepper@redhat.com>
[BZ #5245]
* sysdeps/pthread/createthread.c (do_clone): Translate clone error
if necessary.

nptl/ChangeLog
nptl/sysdeps/pthread/createthread.c

index bc4d43c..bcec5e9 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-08  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #5245]
+       * sysdeps/pthread/createthread.c (do_clone): Translate clone error
+       if necessary.
+
 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #5245]
index 66571b2..59e62c2 100644 (file)
@@ -56,8 +56,8 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
   PREPARE_CREATE;
 #endif
 
-  if (stopped)
-    /* We Make sure the thread does not run far by forcing it to get a
+  if (__builtin_expect (stopped != 0, 0))
+    /* We make sure the thread does not run far by forcing it to get a
        lock.  We lock it here too so that the new thread cannot continue
        until we tell it to.  */
     lll_lock (pd->lock, LLL_PRIVATE);
@@ -84,7 +84,8 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
       if (IS_DETACHED (pd))
        __deallocate_stack (pd);
 
-      return errno;
+      /* We have to translate error codes.  */
+      return errno == ENOMEM ? EAGAIN : errno;
     }
 
   /* Now we have the possibility to set scheduling parameters etc.  */