From: guenther Date: Tue, 21 Apr 2015 01:24:28 +0000 (+0000) Subject: Eliminate the last uses of *fork's second syscall return register; the pid X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=11225f0757374d04e2b2014b86f63d569daf23c0;p=openbsd Eliminate the last uses of *fork's second syscall return register; the pid is zero in the child ok deraadt@ miod@ --- diff --git a/lib/libc/arch/amd64/sys/tfork_thread.S b/lib/libc/arch/amd64/sys/tfork_thread.S index f8ddde0662f..cd9937fa168 100644 --- a/lib/libc/arch/amd64/sys/tfork_thread.S +++ b/lib/libc/arch/amd64/sys/tfork_thread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tfork_thread.S,v 1.3 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: tfork_thread.S,v 1.4 2015/04/21 01:24:28 guenther Exp $ */ /*- * Copyright (c) 2000 Peter Wemm * Copyright (c) 2003 Alan L. Cox @@ -61,8 +61,8 @@ ENTRY(__tfork_thread) /* * Check to see if we are in the parent or child */ - cmpl $0, %edx - jnz 1f + cmpl $0, %eax + jz 1f ret /* diff --git a/lib/libc/arch/i386/sys/tfork_thread.S b/lib/libc/arch/i386/sys/tfork_thread.S index 119cc0d3db3..6affc398e77 100644 --- a/lib/libc/arch/i386/sys/tfork_thread.S +++ b/lib/libc/arch/i386/sys/tfork_thread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tfork_thread.S,v 1.5 2012/12/22 21:07:50 kettenis Exp $ */ +/* $OpenBSD: tfork_thread.S,v 1.6 2015/04/21 01:24:28 guenther Exp $ */ /*- * Copyright (c) 2000 Peter Wemm * All rights reserved. @@ -71,8 +71,8 @@ ENTRY(__tfork_thread) /* * Check to see if we are in the parent or child */ - cmpl $0, %edx - jnz 1f + cmpl $0, %eax + jz 1f addl $12, %esp popl %edi popl %esi