Selaa lähdekoodia

fix errno setting

Mike Frysinger 20 vuotta sitten
vanhempi
commit
1c294afa13
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      libc/sysdeps/linux/x86_64/__syscall_error.c

+ 4 - 2
libc/sysdeps/linux/x86_64/__syscall_error.c

@@ -13,7 +13,9 @@
 int __syscall_error(void) attribute_hidden;
 int __syscall_error(void)
 {
-	register int err_no asm("%rax");
-	__set_errno(-err_no);
+	register int err_no __asm__ ("%rcx");
+	__asm__ ("mov %rax, %rcx\n\t"
+	         "neg %rcx");
+	__set_errno(err_no);
 	return -1;
 }