summaryrefslogtreecommitdiffstats
path: root/base/process_util_linux.cc
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 17:51:51 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 17:51:51 +0000
commit05d4b0ae3154d410443f5ac5d6f74c970ce8d700 (patch)
tree32662f7f9bbb25f81123fb7e34b8bd177d39f161 /base/process_util_linux.cc
parent3216fbdae4d6887bc87240879530fb9f688d013b (diff)
downloadchromium_src-05d4b0ae3154d410443f5ac5d6f74c970ce8d700.zip
chromium_src-05d4b0ae3154d410443f5ac5d6f74c970ce8d700.tar.gz
chromium_src-05d4b0ae3154d410443f5ac5d6f74c970ce8d700.tar.bz2
Add routine to close file descriptors on exec
for linux and mac. See BUG 6598. Review URL: http://codereview.chromium.org/18801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_linux.cc')
-rw-r--r--base/process_util_linux.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index d53b2c7..8f83212 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -44,13 +44,7 @@ bool LaunchApp(const std::vector<std::string>& argv,
// Make sure we don't leak any FDs to the child process by marking all FDs
// as close-on-exec.
- int max_files = GetMaxFilesOpenInProcess();
- for (int i = STDERR_FILENO + 1; i < max_files; i++) {
- int flags = fcntl(i, F_GETFD);
- if (flags != -1) {
- fcntl(i, F_SETFD, flags | FD_CLOEXEC);
- }
- }
+ SetAllFDsToCloseOnExec();
int pid = fork();
if (pid == 0) {