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

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

Issue 25553002: Fix breakage from r28097 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix break in docgen test. Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « pkg/docgen/test/single_library_test.dart ('k') | sdk/lib/io/directory_impl.dart » ('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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // Pattern has overflowed. 386 // Pattern has overflowed.
387 return NULL; 387 return NULL;
388 } 388 }
389 char* result; 389 char* result;
390 do { 390 do {
391 result = mkdtemp(path.AsString()); 391 result = mkdtemp(path.AsString());
392 } while (result == NULL && errno == EINTR); 392 } while (result == NULL && errno == EINTR);
393 if (result == NULL) { 393 if (result == NULL) {
394 return NULL; 394 return NULL;
395 } 395 }
396 int length = strnlen(path.AsString(), PATH_MAX); 396 int length = strlen(path.AsString());
397 result = static_cast<char*>(malloc(length + 1)); 397 result = static_cast<char*>(malloc(length + 1));
398 strncpy(result, path.AsString(), length); 398 strncpy(result, path.AsString(), length);
399 result[length] = '\0'; 399 result[length] = '\0';
400 return result; 400 return result;
401 } 401 }
402 402
403 403
404 bool Directory::Delete(const char* dir_name, bool recursive) { 404 bool Directory::Delete(const char* dir_name, bool recursive) {
405 if (!recursive) { 405 if (!recursive) {
406 if (File::GetType(dir_name, false) == File::kIsLink && 406 if (File::GetType(dir_name, false) == File::kIsLink &&
(...skipping 14 matching lines...) Expand all
421 bool Directory::Rename(const char* path, const char* new_path) { 421 bool Directory::Rename(const char* path, const char* new_path) {
422 ExistsResult exists = Exists(path); 422 ExistsResult exists = Exists(path);
423 if (exists != EXISTS) return false; 423 if (exists != EXISTS) return false;
424 return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0); 424 return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0);
425 } 425 }
426 426
427 } // namespace bin 427 } // namespace bin
428 } // namespace dart 428 } // namespace dart
429 429
430 #endif // defined(TARGET_OS_MACOS) 430 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « pkg/docgen/test/single_library_test.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698