ソースを参照

fix errno setting

Mike Frysinger 18 年 前
コミット
1c294afa13
1 ファイル変更4 行追加2 行削除
  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;
 }