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

Side by Side Diff: runtime/bin/directory_macos.cc

Issue 1293533002: DO NOT SUBMIT: Unix domain sockets. From CL 1061283003. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added Mac OS fix Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/directory_linux.cc ('k') | runtime/bin/eventhandler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MACOS) 6 #if defined(TARGET_OS_MACOS)
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return NO_RETRY_EXPECTED(closedir(dir_pointer)) == 0 && 262 return NO_RETRY_EXPECTED(closedir(dir_pointer)) == 0 &&
263 NO_RETRY_EXPECTED(remove(path->AsString())) == 0; 263 NO_RETRY_EXPECTED(remove(path->AsString())) == 0;
264 } 264 }
265 bool ok = false; 265 bool ok = false;
266 switch (entry.d_type) { 266 switch (entry.d_type) {
267 case DT_DIR: 267 case DT_DIR:
268 ok = DeleteDir(entry.d_name, path); 268 ok = DeleteDir(entry.d_name, path);
269 break; 269 break;
270 case DT_REG: 270 case DT_REG:
271 case DT_LNK: 271 case DT_LNK:
272 case DT_SOCK:
272 // Treat all links as files. This will delete the link which 273 // Treat all links as files. This will delete the link which
273 // is what we want no matter if the link target is a file or a 274 // is what we want no matter if the link target is a file or a
274 // directory. 275 // directory.
275 ok = DeleteFile(entry.d_name, path); 276 ok = DeleteFile(entry.d_name, path);
276 break; 277 break;
277 case DT_UNKNOWN: { 278 case DT_UNKNOWN: {
278 if (!path->Add(entry.d_name)) { 279 if (!path->Add(entry.d_name)) {
279 break; 280 break;
280 } 281 }
281 // On some file systems the entry type is not determined by 282 // On some file systems the entry type is not determined by
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 bool Directory::Rename(const char* path, const char* new_path) { 426 bool Directory::Rename(const char* path, const char* new_path) {
426 ExistsResult exists = Exists(path); 427 ExistsResult exists = Exists(path);
427 if (exists != EXISTS) return false; 428 if (exists != EXISTS) return false;
428 return (NO_RETRY_EXPECTED(rename(path, new_path)) == 0); 429 return (NO_RETRY_EXPECTED(rename(path, new_path)) == 0);
429 } 430 }
430 431
431 } // namespace bin 432 } // namespace bin
432 } // namespace dart 433 } // namespace dart
433 434
434 #endif // defined(TARGET_OS_MACOS) 435 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/directory_linux.cc ('k') | runtime/bin/eventhandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698