diff options
author | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:16:44 +0000 |
---|---|---|
committer | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:16:44 +0000 |
commit | d7908418b3a981cf0712e95c67f7d022e080daa3 (patch) | |
tree | c6222546b45fa6a691daaf1db9ee37093c74784c /third_party | |
parent | d95dd6b96d7881e168d2c37f049d3d4ab8dd6a32 (diff) | |
download | chromium_src-d7908418b3a981cf0712e95c67f7d022e080daa3.zip chromium_src-d7908418b3a981cf0712e95c67f7d022e080daa3.tar.gz chromium_src-d7908418b3a981cf0712e95c67f7d022e080daa3.tar.bz2 |
Don't try to rename LevelDB's LOG file if it doesn't exist
BUG=169328
Review URL: https://chromiumcodereview.appspot.com/11970020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/leveldatabase/env_chromium.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 9f25393..474599c 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc @@ -436,7 +436,10 @@ class ChromiumEnv : public Env, public UMALogger { virtual Status RenameFile(const std::string& src, const std::string& dst) { Status result; - if (!::file_util::ReplaceFile(CreateFilePath(src), CreateFilePath(dst))) { + FilePath src_file_path = CreateFilePath(src); + if (!::file_util::PathExists(src_file_path)) + return result; + if (!::file_util::ReplaceFile(src_file_path, CreateFilePath(dst))) { result = Status::IOError(src, "Could not rename file."); RecordErrorAt(kRenamefile); } else { |