Commit c4d45941 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

chrome: specify locking mode in calls to base::File::Lock().

The distinction between kShared and kExplicit is large enough that there
are significant readability advantages to having the default be explicit
in the code.

Bug: 1125315
Change-Id: Ifeeedc4f51e44e5348177c67d48361da1ac79cc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394720
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804814}
parent 0b7a581e
...@@ -83,7 +83,8 @@ std::unique_ptr<base::File> GetOpenedPolicyFileForUser( ...@@ -83,7 +83,8 @@ std::unique_ptr<base::File> GetOpenedPolicyFileForUser(
return nullptr; return nullptr;
} }
base::File::Error lock_error = policy_file->Lock(); base::File::Error lock_error =
policy_file->Lock(base::File::LockMode::kExclusive);
if (lock_error != base::File::FILE_OK) { if (lock_error != base::File::FILE_OK) {
LOGFN(ERROR) << "Failed to obtain exclusive lock on policy file! Error: " LOGFN(ERROR) << "Failed to obtain exclusive lock on policy file! Error: "
<< lock_error; << lock_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment