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

Side by Side Diff: base/platform_file_posix.cc

Issue 12259025: Linux: apply a different hyphen patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 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
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>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 break; 153 break;
154 default: 154 default:
155 *error = PLATFORM_FILE_ERROR_FAILED; 155 *error = PLATFORM_FILE_ERROR_FAILED;
156 } 156 }
157 } 157 }
158 } 158 }
159 159
160 return descriptor; 160 return descriptor;
161 } 161 }
162 162
163 FILE* FdopenPlatformFile(PlatformFile file, const char* mode) {
164 base::ThreadRestrictions::AssertIOAllowed();
165 return fdopen(file, mode);
166 }
167
163 bool ClosePlatformFile(PlatformFile file) { 168 bool ClosePlatformFile(PlatformFile file) {
164 base::ThreadRestrictions::AssertIOAllowed(); 169 base::ThreadRestrictions::AssertIOAllowed();
165 return !HANDLE_EINTR(close(file)); 170 return !HANDLE_EINTR(close(file));
166 } 171 }
167 172
168 int64 SeekPlatformFile(PlatformFile file, 173 int64 SeekPlatformFile(PlatformFile file,
169 PlatformFileWhence whence, 174 PlatformFileWhence whence,
170 int64 offset) { 175 int64 offset) {
171 base::ThreadRestrictions::AssertIOAllowed(); 176 base::ThreadRestrictions::AssertIOAllowed();
172 if (file < 0 || offset < 0) 177 if (file < 0 || offset < 0)
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 info->is_directory = S_ISDIR(file_info.st_mode); 316 info->is_directory = S_ISDIR(file_info.st_mode);
312 info->is_symbolic_link = S_ISLNK(file_info.st_mode); 317 info->is_symbolic_link = S_ISLNK(file_info.st_mode);
313 info->size = file_info.st_size; 318 info->size = file_info.st_size;
314 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); 319 info->last_modified = base::Time::FromTimeT(file_info.st_mtime);
315 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); 320 info->last_accessed = base::Time::FromTimeT(file_info.st_atime);
316 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); 321 info->creation_time = base::Time::FromTimeT(file_info.st_ctime);
317 return true; 322 return true;
318 } 323 }
319 324
320 } // namespace base 325 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698