From 9f878c2fcab4e497d8b59f69dab74f092ad04deb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 12 Feb 2013 16:07:06 -0800 Subject: [PATCH] Really set errno if __pthread_clone fails. If r0 == 0, we're the child. If r0 > 0, we're the parent. Otherwise set errno. The __bionic_clone code I copy & pasted was wrong. This patch fixes both. Bug: 3461078 Change-Id: Ibb7d6cc7e54e666841f2f0dc59a141a0b31982e4 --- libc/arch-arm/bionic/clone.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/arch-arm/bionic/clone.S b/libc/arch-arm/bionic/clone.S index 6bd6bdf51..39bd79daf 100644 --- a/libc/arch-arm/bionic/clone.S +++ b/libc/arch-arm/bionic/clone.S @@ -47,7 +47,7 @@ ENTRY(__pthread_clone) # In parent, reload saved registers then either exit or set errno. ldmfd sp!, {r4, r7} - bxne lr + bxpl lr b __set_syscall_errno 1: # The child. @@ -96,7 +96,7 @@ ENTRY(__bionic_clone) # In the parent, reload saved registers then either exit or set errno. ldmfd sp!, {r4, r5, r6, r7} - bxne lr + bxpl lr b __set_syscall_errno 1: # The child. -- 2.11.0