| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 #endif | 126 #endif |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool DirectoryIterator::OlderThan(int seconds) const { | 129 bool DirectoryIterator::OlderThan(int seconds) const { |
| 130 time_t file_modify_time; | 130 time_t file_modify_time; |
| 131 #if defined(WEBRTC_WIN) | 131 #if defined(WEBRTC_WIN) |
| 132 FileTimeToUnixTime(data_.ftLastWriteTime, &file_modify_time); | 132 FileTimeToUnixTime(data_.ftLastWriteTime, &file_modify_time); |
| 133 #else | 133 #else |
| 134 file_modify_time = stat_.st_mtime; | 134 file_modify_time = stat_.st_mtime; |
| 135 #endif | 135 #endif |
| 136 return TimeDiff(time(NULL), file_modify_time) >= seconds; | 136 return time(NULL) - file_modify_time >= seconds; |
| 137 } | 137 } |
| 138 | 138 |
| 139 FilesystemInterface* Filesystem::default_filesystem_ = NULL; | 139 FilesystemInterface* Filesystem::default_filesystem_ = NULL; |
| 140 | 140 |
| 141 FilesystemInterface *Filesystem::EnsureDefaultFilesystem() { | 141 FilesystemInterface *Filesystem::EnsureDefaultFilesystem() { |
| 142 if (!default_filesystem_) { | 142 if (!default_filesystem_) { |
| 143 #if defined(WEBRTC_WIN) | 143 #if defined(WEBRTC_WIN) |
| 144 default_filesystem_ = new Win32Filesystem(); | 144 default_filesystem_ = new Win32Filesystem(); |
| 145 #else | 145 #else |
| 146 default_filesystem_ = new UnixFilesystem(); | 146 default_filesystem_ = new UnixFilesystem(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 version += 1; | 275 version += 1; |
| 276 char version_base[MAX_PATH]; | 276 char version_base[MAX_PATH]; |
| 277 sprintfn(version_base, arraysize(version_base), "%s-%u", basename.c_str(), | 277 sprintfn(version_base, arraysize(version_base), "%s-%u", basename.c_str(), |
| 278 version); | 278 version); |
| 279 path.SetBasename(version_base); | 279 path.SetBasename(version_base); |
| 280 } | 280 } |
| 281 return true; | 281 return true; |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace rtc | 284 } // namespace rtc |
| OLD | NEW |