From 3391a9ff139d57fe4f8a2ff2d81a5ddc230a6208 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 22 Apr 2015 21:40:38 -0700 Subject: Simplify close(2) EINTR handling. This doesn't affect code like Chrome that correctly ignores EINTR on close, makes code that tries TEMP_FAILURE_RETRY work (where before it might have closed a different fd and appeared to succeed, or had a bogus EBADF), and makes "goto fail" code work (instead of mistakenly assuming that EINTR means that the close failed). Who loses? Anyone actively trying to detect that they caught a signal while in close(2). I don't think those people exist, and I think they have better alternatives available. Bug: https://code.google.com/p/chromium/issues/detail?id=269623 Bug: http://b/20501816 Change-Id: I11e2f66532fe5d1b0082b2433212e24bdda8219b --- libc/arch-mips64/syscalls/___close.S | 26 ++++++++++++++++++++++++++ libc/arch-mips64/syscalls/close.S | 25 ------------------------- 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 libc/arch-mips64/syscalls/___close.S delete mode 100644 libc/arch-mips64/syscalls/close.S (limited to 'libc/arch-mips64') diff --git a/libc/arch-mips64/syscalls/___close.S b/libc/arch-mips64/syscalls/___close.S new file mode 100644 index 0000000..f1ce708 --- /dev/null +++ b/libc/arch-mips64/syscalls/___close.S @@ -0,0 +1,26 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(___close) + .set push + .set noreorder + li v0, __NR_close + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno_internal + .cpreturn + j t9 + move ra, t0 + .set pop +END(___close) +.hidden ___close diff --git a/libc/arch-mips64/syscalls/close.S b/libc/arch-mips64/syscalls/close.S deleted file mode 100644 index 5e237dd..0000000 --- a/libc/arch-mips64/syscalls/close.S +++ /dev/null @@ -1,25 +0,0 @@ -/* Generated by gensyscalls.py. Do not edit. */ - -#include - -ENTRY(close) - .set push - .set noreorder - li v0, __NR_close - syscall - bnez a3, 1f - move a0, v0 - j ra - nop -1: - move t0, ra - bal 2f - nop -2: - .cpsetup ra, t1, 2b - LA t9,__set_errno_internal - .cpreturn - j t9 - move ra, t0 - .set pop -END(close) -- cgit v1.1