aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-03 14:12:08 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-03 14:12:08 +0000
commit036dec3eccf7fd2a6d4edf8bb1f0f4242c360766 (patch)
tree901fd208a852d23b90a6dcd44ba7d28cd7e15cd7 /src/common/linux
parentRe-enable ios_exception_minidump_generator being built on non-ARM. (diff)
downloadbreakpad-036dec3eccf7fd2a6d4edf8bb1f0f4242c360766.tar.xz
Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.
It is incorrect to wrap close in HANDLE_EINTR on Linux. Unnecessary #includes of eintr_wrapper.h are also removed. The variable naming within the macro is also updated per Chromium r178174. einter_wrapper.h contains a non-mechanical change. Mechanical changes were generated by running: sed -E -i '' \ -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \ -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \ -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \ $(grep -rl HANDLE_EINTR.*close . --exclude-dir=.svn) sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(grep -Elr '#include.*eintr_wrapper\.h"' . --exclude-dir=.svn)) BUG=chromium:269623 R=ted.mielczarek@gmail.com Review URL: https://breakpad.appspot.com/784002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1239 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux')
-rw-r--r--src/common/linux/eintr_wrapper.h19
-rw-r--r--src/common/linux/memory_mapped_file_unittest.cc1
2 files changed, 15 insertions, 5 deletions
diff --git a/src/common/linux/eintr_wrapper.h b/src/common/linux/eintr_wrapper.h
index 20b6bed1..35e5e245 100644
--- a/src/common/linux/eintr_wrapper.h
+++ b/src/common/linux/eintr_wrapper.h
@@ -37,11 +37,22 @@
//
#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 // COMMON_LINUX_EINTR_WRAPPER_H_
diff --git a/src/common/linux/memory_mapped_file_unittest.cc b/src/common/linux/memory_mapped_file_unittest.cc
index 7c34e708..4fa50cf9 100644
--- a/src/common/linux/memory_mapped_file_unittest.cc
+++ b/src/common/linux/memory_mapped_file_unittest.cc
@@ -37,7 +37,6 @@
#include <string>
#include "breakpad_googletest_includes.h"
-#include "common/linux/eintr_wrapper.h"
#include "common/linux/memory_mapped_file.h"
#include "common/tests/auto_tempdir.h"
#include "common/tests/file_utils.h"