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

Unified Diff: chrome/browser/process_singleton_posix.cc

Issue 1984263002: process_singleton_posix: Remove the singleton lock file is not a symlink Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_posix.cc
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index d5394b857a367f8806f408c9d527cc7f5b53d96e..4476834c8dad89f3e5ef335b0cf9af109a36222d 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -279,6 +279,12 @@ bool SymlinkPath(const base::FilePath& target, const base::FilePath& path) {
bool ParseLockPath(const base::FilePath& path,
std::string* hostname,
int* pid) {
+ // The lock file should be a symlink, not a regular file or a directory.
+ if (base::PathExists(path) && !base::IsLink(path)) {
+ base::DeleteFile(path, true);
+ return false;
+ }
+
std::string real_path = ReadLink(path).value();
if (real_path.empty())
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698