Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: ppapi/tests/test_broker.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_broker.cc
diff --git a/ppapi/tests/test_broker.cc b/ppapi/tests/test_broker.cc
index 0537b953a29abd47a560bba602e80b5ae3f7f4d2..db2fa3ffbb39e2e7d2bd6c33a2f483cf7e4f872e 100644
--- a/ppapi/tests/test_broker.cc
+++ b/ppapi/tests/test_broker.cc
@@ -58,13 +58,26 @@ PlatformFile IntToPlatformFile(int32_t handle) {
}
#if defined(OS_POSIX)
+
#define HANDLE_EINTR(x) ({ \
- typeof(x) __eintr_result__; \
+ typeof(x) eintr_wrapper_result; \
do { \
- __eintr_result__ = x; \
- } while (__eintr_result__ == -1 && errno == EINTR); \
- __eintr_result__;\
+ eintr_wrapper_result = (x); \
+ } while (eintr_wrapper_result == -1 && errno == EINTR); \
+ 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; \
+})
+
#endif
bool ReadMessage(PlatformFile file, size_t message_len, char* message) {
@@ -121,7 +134,7 @@ bool ClosePlatformFile(PlatformFile file) {
#if defined(OS_WIN)
return !!::CloseHandle(file);
#elif defined(OS_POSIX)
- return !HANDLE_EINTR(::close(file));
+ return !IGNORE_EINTR(::close(file));
#endif
}
@@ -147,7 +160,7 @@ bool VerifyIsUnsandboxed() {
if (-1 == fd)
return false;
- if (HANDLE_EINTR(::close(fd))) {
+ if (IGNORE_EINTR(::close(fd))) {
::remove(file_name);
return false;
}
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698