diff options
author | cmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 21:24:04 +0000 |
---|---|---|
committer | cmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 21:24:04 +0000 |
commit | dcc56de45d5f704739bc9f98dbc45a6f3bd532af (patch) | |
tree | 6bac9dc0a74930d0d88d884f7b5675c6c7d17d40 /chrome/common | |
parent | 6c112aedc0ed488c7e00884972fcf21843a8e398 (diff) | |
download | chromium_src-dcc56de45d5f704739bc9f98dbc45a6f3bd532af.zip chromium_src-dcc56de45d5f704739bc9f98dbc45a6f3bd532af.tar.gz chromium_src-dcc56de45d5f704739bc9f98dbc45a6f3bd532af.tar.bz2 |
be more aggressive about removing symlink to latest chrome log
Due to a semantic mismatch between file_util::Delete and the linux library calls I was using, I was running into problems nuking a symlink that pointed at nothing. I realized that I kinda don't care if the symlink is there, or what it's pointing at. I just want to blow it away. Even if I can't, i still want to redirect logging. So I changed to code to reflect this policy.
BUG=None
TEST=Log into Chromium OS, alter /home/chronos/chrome_log to point to some nonexistent file. After reboot, verify that it now correctly points to the most recent chrome_log file in /home/chronos
Review URL: http://codereview.chromium.org/2811003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/logging_chrome.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 9954cca..b1333a2 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -131,10 +131,9 @@ LoggingDestination DetermineLogMode(const CommandLine& command_line) { #if defined(OS_CHROMEOS) void SetUpSymlink(const FilePath& symlink_path, const FilePath& new_log_path) { - if (access(symlink_path.value().c_str(), F_OK) == 0 && - file_util::Delete(symlink_path, false)) { - PLOG(ERROR) << "Unable to unlink " << symlink_path.value(); - } + // We don't care if the unlink fails; we're going to continue anyway. + if (unlink(symlink_path.value().c_str()) == -1) + PLOG(WARNING) << "Unable to unlink " << symlink_path.value(); if (symlink(new_log_path.value().c_str(), symlink_path.value().c_str()) == -1) { PLOG(ERROR) << "Unable to create symlink " << symlink_path.value() |