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

Unified Diff: base/platform_file_posix.cc

Issue 174232: Chromium side patch for DB support on Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Final version, including changes to the DEPS file. Created 11 years, 4 months 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 | « base/platform_file.h ('k') | base/platform_file_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_posix.cc
===================================================================
--- base/platform_file_posix.cc (revision 24791)
+++ base/platform_file_posix.cc (working copy)
@@ -52,6 +52,10 @@
*created = false;
} else {
open_flags |= O_CREAT;
+ if (flags & PLATFORM_FILE_EXCLUSIVE_READ ||
+ flags & PLATFORM_FILE_EXCLUSIVE_WRITE) {
+ open_flags |= O_EXCL; // together with O_CREAT implies O_NOFOLLOW
+ }
descriptor = open(WideToUTF8(name).c_str(), open_flags,
S_IRUSR | S_IWUSR);
if (created && descriptor > 0)
@@ -59,7 +63,15 @@
}
}
+ if ((descriptor > 0) && (flags & PLATFORM_FILE_DELETE_ON_CLOSE)) {
+ unlink(WideToUTF8(name).c_str());
+ }
+
return descriptor;
}
+bool ClosePlatformFile(PlatformFile file) {
+ return close(file);
+}
+
} // namespace base
« no previous file with comments | « base/platform_file.h ('k') | base/platform_file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698