Don't HANDLE_EINTR(close). Use IGNORE_EINTR(close).
It is incorrect to wrap close in HANDLE_EINTR on Linux. BUG=chromium:269623 R=fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/4759004 Patch from Mark Mentovai <mark@chromium.org>. git-svn-id: http://webrtc.googlecode.com/svn/trunk@5206 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -20,6 +20,17 @@
|
||||
eintr_wrapper_result; \
|
||||
})
|
||||
|
||||
#define IGNORE_EINTR(x) ({ \
|
||||
typeof(x) eintr_wrapper_result; \
|
||||
do { \
|
||||
eintr_wrapper_result = (x); \
|
||||
if (eintr_wrapper_result == -1 && errno == EINTR) { \
|
||||
eintr_wrapper_result = 0; \
|
||||
} \
|
||||
} while (0); \
|
||||
eintr_wrapper_result; \
|
||||
})
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
const LowLatencyEvent::Handle LowLatencyEvent::kInvalidHandle = -1;
|
||||
@@ -61,7 +72,7 @@ bool LowLatencyEvent::Close(Handle* handle) {
|
||||
if (*handle == kInvalidHandle) {
|
||||
return false;
|
||||
}
|
||||
int retval = HANDLE_EINTR(close(*handle));
|
||||
int retval = IGNORE_EINTR(close(*handle));
|
||||
*handle = kInvalidHandle;
|
||||
return retval == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user