From fb1802d9b238ecb7066ab0867d8c4c3c3acefaea Mon Sep 17 00:00:00 2001 From: mirabilos Date: Fri, 24 Jul 2015 22:18:07 +0200 Subject: =?UTF-8?q?integrate=20old=20m68k=20vfork=20bugfix=20of=20pre-?= =?UTF-8?q?=C2=B5Clibc-ng=20tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libc/sysdeps/linux/m68k/vfork.S | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libc/sysdeps/linux/m68k/vfork.S b/libc/sysdeps/linux/m68k/vfork.S index b2fe03377..bde9d5a3a 100644 --- a/libc/sysdeps/linux/m68k/vfork.S +++ b/libc/sysdeps/linux/m68k/vfork.S @@ -22,20 +22,23 @@ __vfork: movl %sp@+, %a1 /* save the return address for later */ movl IMM __NR_vfork,%d0 trap #0 - movl IMM -4097, %d1 - cmpl %d0, %d1 - bcs fix_errno - jmp %a1@ /* don't return, just jmp directly */ -fix_errno: - negl %d0 + movl %a1, -(%sp) + + cmpil #-4096,%d0 + blss 1f + + neg.l %d0 #ifndef __PIC__ /* needs handling as the other archs */ movl errno, %a0 #else movl errno@GOT(%a5), %a0 #endif movl %d0, %a0@ - movl IMM -1, %d0 - jmp %a1@ /* don't return, just jmp directly */ + move.l #-1, %d0 + +1: + move.l %d0, %a0 + rts .size __vfork,.-__vfork weak_alias(__vfork,vfork) -- cgit v1.2.3