Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: runtime/bin/file_android.cc

Issue 11419008: Added O_CLOEXEC to the flags parameter of open() calls (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/file_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_android.cc
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 77665e6f8c0639e1f48c0ebe7ff34e499cc4ab41..66e625164d5ef823ee35deca28cedc0e4eb863fc 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -115,6 +115,7 @@ File* File::Open(const char* name, FileOpenMode mode) {
if ((mode & kTruncate) != 0) {
flags = flags | O_TRUNC;
}
+ flags |= O_CLOEXEC;
int fd = TEMP_FAILURE_RETRY(open(name, flags, 0666));
if (fd < 0) {
return NULL;
@@ -146,7 +147,7 @@ bool File::Exists(const char* name) {
bool File::Create(const char* name) {
- int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CREAT, 0666));
+ int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
if (fd < 0) {
return false;
}
« no previous file with comments | « no previous file | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698