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

Side by Side Diff: base/platform_file_posix.cc

Issue 6469070: More DCHECK() updates. A mixture of _EQ and _GE. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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 | « base/pickle.h ('k') | base/shared_memory_posix.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) 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/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 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 !(flags & PLATFORM_FILE_WRITE_ATTRIBUTES) && 58 !(flags & PLATFORM_FILE_WRITE_ATTRIBUTES) &&
59 !(flags & PLATFORM_FILE_OPEN_ALWAYS)) { 59 !(flags & PLATFORM_FILE_OPEN_ALWAYS)) {
60 NOTREACHED(); 60 NOTREACHED();
61 } 61 }
62 62
63 if (flags & PLATFORM_FILE_TRUNCATE) { 63 if (flags & PLATFORM_FILE_TRUNCATE) {
64 DCHECK(flags & PLATFORM_FILE_WRITE); 64 DCHECK(flags & PLATFORM_FILE_WRITE);
65 open_flags |= O_TRUNC; 65 open_flags |= O_TRUNC;
66 } 66 }
67 67
68 DCHECK(O_RDONLY == 0); 68 DCHECK_EQ(O_RDONLY, 0U);
willchan no longer on Chromium 2011/02/21 23:17:20 Strange. O_RDONLY is a constant. Why do we have a
KushalP 2011/02/22 00:57:29 Sure, I'll look into it. Isn't the second argumen
69 69
70 int descriptor = open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR); 70 int descriptor = open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR);
71 71
72 if (flags & PLATFORM_FILE_OPEN_ALWAYS) { 72 if (flags & PLATFORM_FILE_OPEN_ALWAYS) {
73 if (descriptor > 0) { 73 if (descriptor > 0) {
74 if (created) 74 if (created)
75 *created = false; 75 *created = false;
76 } else { 76 } else {
77 open_flags |= O_CREAT; 77 open_flags |= O_CREAT;
78 if (flags & PLATFORM_FILE_EXCLUSIVE_READ || 78 if (flags & PLATFORM_FILE_EXCLUSIVE_READ ||
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 info->is_directory = S_ISDIR(file_info.st_mode); 189 info->is_directory = S_ISDIR(file_info.st_mode);
190 info->is_symbolic_link = S_ISLNK(file_info.st_mode); 190 info->is_symbolic_link = S_ISLNK(file_info.st_mode);
191 info->size = file_info.st_size; 191 info->size = file_info.st_size;
192 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); 192 info->last_modified = base::Time::FromTimeT(file_info.st_mtime);
193 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); 193 info->last_accessed = base::Time::FromTimeT(file_info.st_atime);
194 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); 194 info->creation_time = base::Time::FromTimeT(file_info.st_ctime);
195 return true; 195 return true;
196 } 196 }
197 197
198 } // namespace base 198 } // namespace base
OLDNEW
« no previous file with comments | « base/pickle.h ('k') | base/shared_memory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698