summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-05 06:56:03 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-05 06:56:03 +0000
commit3ae9a40e28c7c4b06ac0f06837162bf4ac9d60d8 (patch)
tree1d084280c98c26ad59cecc035cbcb96d8c25189f /libc
parent64d5a0b1fb305691657df2f562a27562c5a2b927 (diff)
Jeroen Dobbelaere writes:
Because variables are linked to fixed registers, there is a problem in : (*__errno_location())=(-_r0); As __errno_location() uses r0 to return the address of the errno location, the negated address will be assigned instead of the error code. Attached patch will resolve this.
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/arm/syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/arm/syscall.c b/libc/sysdeps/linux/arm/syscall.c
index ec2907939..65afa03ae 100644
--- a/libc/sysdeps/linux/arm/syscall.c
+++ b/libc/sysdeps/linux/arm/syscall.c
@@ -41,7 +41,8 @@ long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
"r"(_r6)
: "memory");
if(_r0 >=(unsigned long) -4095) {
- (*__errno_location())=(-_r0);
+ long err = _r0;
+ (*__errno_location())=(-err);
_r0=(unsigned long) -1;
}
return (long) _r0;