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

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

Issue 9452009: Fix bug in Directory after porting to using native ports (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « no previous file | runtime/bin/directory_win.cc » ('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 "bin/directory.h" 5 #include "bin/directory.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 DirectoryListing *listing) { 64 DirectoryListing *listing) {
65 if (strcmp(dir_name, ".") != 0 && 65 if (strcmp(dir_name, ".") != 0 &&
66 strcmp(dir_name, "..") != 0) { 66 strcmp(dir_name, "..") != 0) {
67 size_t written = snprintf(path + path_length, 67 size_t written = snprintf(path + path_length,
68 PATH_MAX - path_length, 68 PATH_MAX - path_length,
69 "%s", 69 "%s",
70 dir_name); 70 dir_name);
71 if (written != strlen(dir_name)) { 71 if (written != strlen(dir_name)) {
72 return false; 72 return false;
73 } 73 }
74 bool ok = listing->HandleDirectory(dir_name); 74 bool ok = listing->HandleDirectory(path);
75 if (!ok) return ok; 75 if (!ok) return ok;
76 if (recursive) { 76 if (recursive) {
77 return ListRecursively(path, recursive, listing); 77 return ListRecursively(path, recursive, listing);
78 } 78 }
79 } 79 }
80 return true; 80 return true;
81 } 81 }
82 82
83 83
84 static bool HandleFile(char* file_name, 84 static bool HandleFile(char* file_name,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 } 418 }
419 419
420 420
421 bool Directory::Delete(const char* dir_name, bool recursive) { 421 bool Directory::Delete(const char* dir_name, bool recursive) {
422 if (!recursive) { 422 if (!recursive) {
423 return (TEMP_FAILURE_RETRY(remove(dir_name)) == 0); 423 return (TEMP_FAILURE_RETRY(remove(dir_name)) == 0);
424 } else { 424 } else {
425 return DeleteRecursively(dir_name); 425 return DeleteRecursively(dir_name);
426 } 426 }
427 } 427 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/directory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698