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

Unified Diff: rlz/mac/lib/rlz_value_store_mac.mm

Issue 10882005: Merge 152659 - mac/rlz: Remove an incorrect check (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 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 | « rlz/lib/rlz_value_store.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/mac/lib/rlz_value_store_mac.mm
===================================================================
--- rlz/mac/lib/rlz_value_store_mac.mm (revision 152887)
+++ rlz/mac/lib/rlz_value_store_mac.mm (working copy)
@@ -270,7 +270,9 @@
const int kSleepPerTryMS = 200;
CHECK(file_lock_ == -1);
- file_lock_ = open([lock_filename fileSystemRepresentation], O_CREAT, 0666);
+ file_lock_ = open([lock_filename fileSystemRepresentation],
+ O_RDWR | O_CREAT,
+ 0666);
if (file_lock_ == -1)
return false;
@@ -354,8 +356,8 @@
// Returns the path of the rlz lock file, also creates the parent directory
// path if it doesn't exist.
NSString* RlzLockFilename() {
- NSString* const kRlzFile = @"flockfile";
- return [CreateRlzDirectory() stringByAppendingPathComponent:kRlzFile];
+ NSString* const kRlzLockfile = @"flockfile";
+ return [CreateRlzDirectory() stringByAppendingPathComponent:kRlzLockfile];
}
} // namespace
@@ -377,8 +379,8 @@
}
if (g_lock_depth > 1) {
- // Reuse the already existing store object.
- CHECK(g_store_object);
+ // Reuse the already existing store object. Note that it can be NULL when
+ // lock acquisition succeeded but the rlz data file couldn't be read.
store_.reset(g_store_object);
return;
}
@@ -449,6 +451,12 @@
}
}
+std::string RlzPlistFilenameStr() {
+ @autoreleasepool {
+ return std::string([RlzPlistFilename() fileSystemRepresentation]);
+ }
+}
+
} // namespace testing
} // namespace rlz_lib
Property changes on: rlz/mac/lib/rlz_value_store_mac.mm
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « rlz/lib/rlz_value_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698