summaryrefslogtreecommitdiffstats
path: root/base/test
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 14:10:59 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 14:10:59 +0000
commitd89eec809e2d25aee8d386186653699f5017b15b (patch)
treeb8b0433f5766958907ea4cebb7b954e82fc1148a /base/test
parent34b5946e889071a9c838a4b87d32437415148fed (diff)
downloadchromium_src-d89eec809e2d25aee8d386186653699f5017b15b.zip
chromium_src-d89eec809e2d25aee8d386186653699f5017b15b.tar.gz
chromium_src-d89eec809e2d25aee8d386186653699f5017b15b.tar.bz2
Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.
It is incorrect to wrap close in HANDLE_EINTR on Linux. Correctness is generally undefined on Mac, but as of r223369, it is incorrect in Chrome on Mac. To avoid new offenders, a PRESUBMIT check ensures that HANDLE_EINTR is not used with close, and that IGNORE_EINTR is only used with close. Unnecessary #includes of eintr_wrapper.h are also removed. base/posix/einter_wrapper.h, PRESUBMIT.py, and ppapi/tests/test_broker.cc contain non-mechanical changes. Variable naming within the latter is updated per r178174. Missing #includes for <errno.h> in content/zygote/zygote_main_linux.cc and tools/android/common/daemon.cc were manually added. 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/' \ $(git grep -El 'HANDLE_EINTR.*close') sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(git grep -El '#include.*eintr_wrapper\.h"')) BUG=269623 R=agl@chromium.org, jln@chromium.org TBR=OWNERS Review URL: https://codereview.chromium.org/100253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test')
-rw-r--r--base/test/multiprocess_test_android.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/base/test/multiprocess_test_android.cc b/base/test/multiprocess_test_android.cc
index 9367426..51c2ce02 100644
--- a/base/test/multiprocess_test_android.cc
+++ b/base/test/multiprocess_test_android.cc
@@ -8,7 +8,6 @@
#include "base/containers/hash_tables.h"
#include "base/logging.h"
-#include "base/posix/eintr_wrapper.h"
#include "testing/multiprocess_func_list.h"
namespace base {
@@ -42,7 +41,7 @@ ProcessHandle MultiProcessTest::SpawnChildImpl(
const int kFdForAndroidLogging = 3; // FD used by __android_log_write().
for (int fd = kFdForAndroidLogging + 1; fd < getdtablesize(); ++fd) {
if (fds_to_keep_open.find(fd) == fds_to_keep_open.end()) {
- HANDLE_EINTR(close(fd));
+ close(fd);
}
}
for (FileHandleMappingVector::const_iterator it = fds_to_remap.begin();
@@ -52,7 +51,7 @@ ProcessHandle MultiProcessTest::SpawnChildImpl(
if (dup2(old_fd, new_fd) < 0) {
PLOG(FATAL) << "dup2";
}
- HANDLE_EINTR(close(old_fd));
+ close(old_fd);
}
_exit(multi_process_function_list::InvokeChildProcessTest(procname));
return 0;