| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium 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. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test_file_util.h" | 5 #include "base/test_file_util.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fts.h> | 8 #include <fts.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (errno != EEXIST) | 56 if (errno != EEXIST) |
| 57 error = errno; | 57 error = errno; |
| 58 } | 58 } |
| 59 break; | 59 break; |
| 60 case FTS_F: // Regular file. | 60 case FTS_F: // Regular file. |
| 61 case FTS_NSOK: // File, no stat info requested. | 61 case FTS_NSOK: // File, no stat info requested. |
| 62 { | 62 { |
| 63 errno = 0; | 63 errno = 0; |
| 64 FilePath source_path(ent->fts_path); | 64 FilePath source_path(ent->fts_path); |
| 65 if (CopyFile(source_path, target_path)) { | 65 if (CopyFile(source_path, target_path)) { |
| 66 bool success = EvictFileFromSystemCache( | 66 bool success = EvictFileFromSystemCache(target_path); |
| 67 target_path.Append(source_path.BaseName())); | |
| 68 DCHECK(success); | 67 DCHECK(success); |
| 69 } else { | 68 } else { |
| 70 error = errno ? errno : EINVAL; | 69 error = errno ? errno : EINVAL; |
| 71 } | 70 } |
| 72 } | 71 } |
| 73 break; | 72 break; |
| 74 case FTS_DP: // Postorder directory. | 73 case FTS_DP: // Postorder directory. |
| 75 case FTS_DOT: // "." or ".." | 74 case FTS_DOT: // "." or ".." |
| 76 // Skip it. | 75 // Skip it. |
| 77 continue; | 76 continue; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 109 } |
| 111 | 110 |
| 112 if (error) { | 111 if (error) { |
| 113 LOG(ERROR) << strerror(error); | 112 LOG(ERROR) << strerror(error); |
| 114 return false; | 113 return false; |
| 115 } | 114 } |
| 116 return true; | 115 return true; |
| 117 } | 116 } |
| 118 | 117 |
| 119 } // namespace file_util | 118 } // namespace file_util |
| OLD | NEW |