aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/i386/vfork.S
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/vfork.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/vfork.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/vfork.S b/nptl/sysdeps/unix/sysv/linux/i386/vfork.S
index 2b60a5ea5e..52336102c7 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/vfork.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/vfork.S
@@ -21,9 +21,13 @@
/* Save the PID value. */
#define SAVE_PID \
movl %gs:PID, %edx; \
- movl $-1, %gs:PID
+ movl %edx, %eax; \
+ negl %eax; \
+ jne 1f; \
+ movl $0x80000000, %eax; \
+1: movl %eax, %gs:PID
-/* Restore the old PID value in the parent. In the child store 0. */
+/* Restore the old PID value in the parent. */
#define RESTORE_PID \
testl %eax, %eax; \
je 1f; \