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: base/platform_file_posix.cc

Issue 10808037: Update #if guards in base/ that control whether to use stat or stat64 (and friends). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MACOSX < IOS Created 8 years, 5 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 | « base/file_util_posix.cc ('k') | no next file » | 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 Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/platform_file.h" 5 #include "base/platform_file.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <unistd.h> 10 #include <unistd.h>
11 11
12 #include "base/eintr_wrapper.h" 12 #include "base/eintr_wrapper.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/threading/thread_restrictions.h" 15 #include "base/threading/thread_restrictions.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 17
18 #if defined(OS_ANDROID) 18 #if defined(OS_ANDROID)
19 #include "base/os_compat_android.h" 19 #include "base/os_compat_android.h"
20 #endif 20 #endif
21 21
22 namespace base { 22 namespace base {
23 23
24 #if defined(OS_BSD) || defined(OS_IOS) || (defined(OS_MACOSX) && \ 24 #if defined(OS_BSD) || defined(OS_MACOSX)
25 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
26 typedef struct stat stat_wrapper_t; 25 typedef struct stat stat_wrapper_t;
27 static int CallFstat(int fd, stat_wrapper_t *sb) { 26 static int CallFstat(int fd, stat_wrapper_t *sb) {
28 base::ThreadRestrictions::AssertIOAllowed(); 27 base::ThreadRestrictions::AssertIOAllowed();
29 return fstat(fd, sb); 28 return fstat(fd, sb);
30 } 29 }
31 #else 30 #else
32 typedef struct stat64 stat_wrapper_t; 31 typedef struct stat64 stat_wrapper_t;
33 static int CallFstat(int fd, stat_wrapper_t *sb) { 32 static int CallFstat(int fd, stat_wrapper_t *sb) {
34 base::ThreadRestrictions::AssertIOAllowed(); 33 base::ThreadRestrictions::AssertIOAllowed();
35 return fstat64(fd, sb); 34 return fstat64(fd, sb);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 info->is_directory = S_ISDIR(file_info.st_mode); 276 info->is_directory = S_ISDIR(file_info.st_mode);
278 info->is_symbolic_link = S_ISLNK(file_info.st_mode); 277 info->is_symbolic_link = S_ISLNK(file_info.st_mode);
279 info->size = file_info.st_size; 278 info->size = file_info.st_size;
280 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); 279 info->last_modified = base::Time::FromTimeT(file_info.st_mtime);
281 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); 280 info->last_accessed = base::Time::FromTimeT(file_info.st_atime);
282 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); 281 info->creation_time = base::Time::FromTimeT(file_info.st_ctime);
283 return true; 282 return true;
284 } 283 }
285 284
286 } // namespace base 285 } // namespace base
OLDNEW
« no previous file with comments | « base/file_util_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698