summaryrefslogtreecommitdiffstats
path: root/chromeos/process_proxy
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 /chromeos/process_proxy
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 'chromeos/process_proxy')
-rw-r--r--chromeos/process_proxy/process_output_watcher.cc2
-rw-r--r--chromeos/process_proxy/process_output_watcher_unittest.cc4
-rw-r--r--chromeos/process_proxy/process_proxy.cc2
-rw-r--r--chromeos/process_proxy/process_proxy_unittest.cc1
4 files changed, 4 insertions, 5 deletions
diff --git a/chromeos/process_proxy/process_output_watcher.cc b/chromeos/process_proxy/process_output_watcher.cc
index 40ed8cf..f063984 100644
--- a/chromeos/process_proxy/process_output_watcher.cc
+++ b/chromeos/process_proxy/process_output_watcher.cc
@@ -26,7 +26,7 @@ void InitReadFdSet(int out_fd, int stop_fd, fd_set* set) {
void CloseFd(int* fd) {
if (*fd >= 0) {
- if (HANDLE_EINTR(close(*fd)) != 0)
+ if (IGNORE_EINTR(close(*fd)) != 0)
DPLOG(WARNING) << "close fd " << *fd << " failed.";
}
*fd = -1;
diff --git a/chromeos/process_proxy/process_output_watcher_unittest.cc b/chromeos/process_proxy/process_output_watcher_unittest.cc
index 9ff8d89..b45d137 100644
--- a/chromeos/process_proxy/process_output_watcher_unittest.cc
+++ b/chromeos/process_proxy/process_output_watcher_unittest.cc
@@ -127,8 +127,8 @@ public:
// Send stop signal. It is not important which string we send.
EXPECT_EQ(1, file_util::WriteFileDescriptor(stop_pipe[1], "q", 1));
- EXPECT_NE(-1, HANDLE_EINTR(close(stop_pipe[1])));
- EXPECT_NE(-1, HANDLE_EINTR(close(pt_pipe[1])));
+ EXPECT_NE(-1, IGNORE_EINTR(close(stop_pipe[1])));
+ EXPECT_NE(-1, IGNORE_EINTR(close(pt_pipe[1])));
output_watch_thread.Stop();
}
diff --git a/chromeos/process_proxy/process_proxy.cc b/chromeos/process_proxy/process_proxy.cc
index b61ec9f..3ae1d21 100644
--- a/chromeos/process_proxy/process_proxy.cc
+++ b/chromeos/process_proxy/process_proxy.cc
@@ -244,7 +244,7 @@ void ProcessProxy::CloseFdPair(int* pipe) {
void ProcessProxy::CloseFd(int* fd) {
if (*fd != kInvalidFd) {
- if (HANDLE_EINTR(close(*fd)) != 0)
+ if (IGNORE_EINTR(close(*fd)) != 0)
DPLOG(WARNING) << "close fd failed.";
}
*fd = kInvalidFd;
diff --git a/chromeos/process_proxy/process_proxy_unittest.cc b/chromeos/process_proxy/process_proxy_unittest.cc
index 429c868..badb7dc 100644
--- a/chromeos/process_proxy/process_proxy_unittest.cc
+++ b/chromeos/process_proxy/process_proxy_unittest.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "base/posix/eintr_wrapper.h"
#include "base/process/kill.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"