| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
| 9 | 9 |
| 10 #include <dirent.h> // NOLINT | 10 #include <dirent.h> // NOLINT |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void PathBuffer::Reset(int new_length) { | 62 void PathBuffer::Reset(int new_length) { |
| 63 length_ = new_length; | 63 length_ = new_length; |
| 64 AsString()[length_] = '\0'; | 64 AsString()[length_] = '\0'; |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 // A linked list of symbolic links, with their unique file system identifiers. | 68 // A linked list of symbolic links, with their unique file system identifiers. |
| 69 // These are scanned to detect loops while doing a recursive directory listing. | 69 // These are scanned to detect loops while doing a recursive directory listing. |
| 70 struct LinkList { | 70 struct LinkList { |
| 71 dev_t dev; | 71 dev_t dev; |
| 72 ino_t ino; | 72 ino64_t ino; |
| 73 LinkList* next; | 73 LinkList* next; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 | 76 |
| 77 ListType DirectoryListingEntry::Next(DirectoryListing* listing) { | 77 ListType DirectoryListingEntry::Next(DirectoryListing* listing) { |
| 78 if (done_) { | 78 if (done_) { |
| 79 return kListDone; | 79 return kListDone; |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (lister_ == 0) { | 82 if (lister_ == 0) { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 bool Directory::Rename(const char* path, const char* new_path) { | 437 bool Directory::Rename(const char* path, const char* new_path) { |
| 438 ExistsResult exists = Exists(path); | 438 ExistsResult exists = Exists(path); |
| 439 if (exists != EXISTS) return false; | 439 if (exists != EXISTS) return false; |
| 440 return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0); | 440 return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace bin | 443 } // namespace bin |
| 444 } // namespace dart | 444 } // namespace dart |
| 445 | 445 |
| 446 #endif // defined(TARGET_OS_LINUX) | 446 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |