OLD | NEW |
1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved. | 1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. See the AUTHORS file for names of contributors. | 3 // found in the LICENSE file. See the AUTHORS file for names of contributors. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 file = ::base::CreatePlatformFile( | 702 file = ::base::CreatePlatformFile( |
703 CreateFilePath(fname), flags, &created, &error_code); | 703 CreateFilePath(fname), flags, &created, &error_code); |
704 } while (error_code != ::base::PLATFORM_FILE_OK && | 704 } while (error_code != ::base::PLATFORM_FILE_OK && |
705 retrier.ShouldKeepTrying(error_code)); | 705 retrier.ShouldKeepTrying(error_code)); |
706 | 706 |
707 if (error_code == ::base::PLATFORM_FILE_ERROR_NOT_FOUND) { | 707 if (error_code == ::base::PLATFORM_FILE_ERROR_NOT_FOUND) { |
708 ::base::FilePath parent = CreateFilePath(fname).DirName(); | 708 ::base::FilePath parent = CreateFilePath(fname).DirName(); |
709 ::base::FilePath last_parent; | 709 ::base::FilePath last_parent; |
710 int num_missing_ancestors = 0; | 710 int num_missing_ancestors = 0; |
711 do { | 711 do { |
712 if (file_util::DirectoryExists(parent)) | 712 if (base::DirectoryExists(parent)) |
713 break; | 713 break; |
714 ++num_missing_ancestors; | 714 ++num_missing_ancestors; |
715 last_parent = parent; | 715 last_parent = parent; |
716 parent = parent.DirName(); | 716 parent = parent.DirName(); |
717 } while (parent != last_parent); | 717 } while (parent != last_parent); |
718 RecordLockFileAncestors(num_missing_ancestors); | 718 RecordLockFileAncestors(num_missing_ancestors); |
719 } | 719 } |
720 | 720 |
721 if (error_code != ::base::PLATFORM_FILE_OK) { | 721 if (error_code != ::base::PLATFORM_FILE_OK) { |
722 result = MakeIOError( | 722 result = MakeIOError( |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 Env* IDBEnv() { | 957 Env* IDBEnv() { |
958 return leveldb_env::idb_env.Pointer(); | 958 return leveldb_env::idb_env.Pointer(); |
959 } | 959 } |
960 | 960 |
961 Env* Env::Default() { | 961 Env* Env::Default() { |
962 return leveldb_env::default_env.Pointer(); | 962 return leveldb_env::default_env.Pointer(); |
963 } | 963 } |
964 | 964 |
965 } // namespace leveldb | 965 } // namespace leveldb |
966 | 966 |
OLD | NEW |