about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-11-08 17:24:34 +0000
committerUlrich Drepper <drepper@redhat.com>2007-11-08 17:24:34 +0000
commit0f7e0ee507c4bfba62c9059451197e9a25a0598e (patch)
treefd03747c2d34e6c132d6ea6357ca86260eb28379
parentf6ed654cabb55cc809bde696ad8357498af39757 (diff)
downloadglibc-0f7e0ee507c4bfba62c9059451197e9a25a0598e.tar.gz
glibc-0f7e0ee507c4bfba62c9059451197e9a25a0598e.tar.xz
glibc-0f7e0ee507c4bfba62c9059451197e9a25a0598e.zip
[BZ #5245]
2007-11-08  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5245]
	* sysdeps/pthread/createthread.c (do_clone): Translate clone error
	if necessary.
-rw-r--r--nptl/ChangeLog6
-rw-r--r--nptl/sysdeps/pthread/createthread.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index bc4d43ce5b..bcec5e9651 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -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]
diff --git a/nptl/sysdeps/pthread/createthread.c b/nptl/sysdeps/pthread/createthread.c
index 66571b2175..59e62c2dcf 100644
--- a/nptl/sysdeps/pthread/createthread.c
+++ b/nptl/sysdeps/pthread/createthread.c
@@ -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.  */