summaryrefslogtreecommitdiffstats
path: root/base/process_util_unittest.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 02:28:16 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 02:28:16 +0000
commitcabe39c43a98b6b635951d5cb3649e061e36ea21 (patch)
treec76282b5ed8452f490edbda9ed0a32bf364b5d6a /base/process_util_unittest.cc
parentce716d859764f7a6e8ea0c79bbcd445d856f4da0 (diff)
downloadchromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.zip
chromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.tar.gz
chromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.tar.bz2
linux: check the return value passed through HANDLE_EINTR
A smarter compiler (clang) can notice that we were not using the return values being passed through HANDLE_EINTR, which meant most frequently that we were missing checking the return value of close(). Review URL: http://codereview.chromium.org/569003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r--base/process_util_unittest.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 2ccca54..6ab081e 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -238,7 +238,8 @@ MULTIPROCESS_TEST_MAIN(ProcessUtilsLeakFDChildProcess) {
int written = HANDLE_EINTR(write(write_pipe, &num_open_files,
sizeof(num_open_files)));
DCHECK_EQ(static_cast<size_t>(written), sizeof(num_open_files));
- HANDLE_EINTR(close(write_pipe));
+ int ret = HANDLE_EINTR(close(write_pipe));
+ DPCHECK(ret == 0);
return 0;
}
@@ -254,7 +255,8 @@ int ProcessUtilTest::CountOpenFDsInChild() {
fd_mapping_vec,
false);
CHECK(handle);
- HANDLE_EINTR(close(fds[1]));
+ int ret = HANDLE_EINTR(close(fds[1]));
+ DPCHECK(ret == 0);
// Read number of open files in client process from pipe;
int num_open_files = -1;
@@ -264,7 +266,8 @@ int ProcessUtilTest::CountOpenFDsInChild() {
CHECK(WaitForSingleProcess(handle, 1000));
base::CloseProcessHandle(handle);
- HANDLE_EINTR(close(fds[0]));
+ ret = HANDLE_EINTR(close(fds[0]));
+ DPCHECK(ret == 0);
return num_open_files;
}
@@ -282,9 +285,13 @@ TEST_F(ProcessUtilTest, FDRemapping) {
ASSERT_EQ(fds_after, fds_before);
- HANDLE_EINTR(close(sockets[0]));
- HANDLE_EINTR(close(sockets[1]));
- HANDLE_EINTR(close(dev_null));
+ int ret;
+ ret = HANDLE_EINTR(close(sockets[0]));
+ DPCHECK(ret == 0);
+ ret = HANDLE_EINTR(close(sockets[1]));
+ DPCHECK(ret == 0);
+ ret = HANDLE_EINTR(close(dev_null));
+ DPCHECK(ret == 0);
}
TEST_F(ProcessUtilTest, GetAppOutput) {