diff options
author | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 20:50:24 +0000 |
---|---|---|
committer | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 20:50:24 +0000 |
commit | 91b2805a31195aedebb910fa12f886a45fd55bcb (patch) | |
tree | a9a2cb1911bfcad798be0f42f014b714e2b3152c /base/process_util_unittest.cc | |
parent | 3acbccb289ff74d063c4809d8fc20235e99ea314 (diff) | |
download | chromium_src-91b2805a31195aedebb910fa12f886a45fd55bcb.zip chromium_src-91b2805a31195aedebb910fa12f886a45fd55bcb.tar.gz chromium_src-91b2805a31195aedebb910fa12f886a45fd55bcb.tar.bz2 |
Fix ProcessUtilTest.FDRemapping hang on x86_64 by counting open fds in child process nondestructively
BUG=25270
TEST=base_unittests --gtest_filter=ProcessUtilTest.FDRemapping on x86_64 linux
Review URL: http://codereview.chromium.org/293018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29570 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index 4389e6e..0dfcd2b 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -198,7 +198,9 @@ MULTIPROCESS_TEST_MAIN(ProcessUtilsLeakFDChildProcess) { int max_files = GetMaxFilesOpenInProcess(); for (int i = STDERR_FILENO + 1; i < max_files; i++) { if (i != kChildPipe) { - if (HANDLE_EINTR(close(i)) != -1) { + int fd; + if ((fd = HANDLE_EINTR(dup(i))) != -1) { + close(fd); num_open_files += 1; } } |