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

Side by Side Diff: base/platform_file_posix.cc

Issue 9043: quick build fix for Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 22
23 if (flags & PLATFORM_FILE_CREATE_ALWAYS) { 23 if (flags & PLATFORM_FILE_CREATE_ALWAYS) {
24 DCHECK(!open_flags); 24 DCHECK(!open_flags);
25 open_flags = O_CREAT | O_TRUNC; 25 open_flags = O_CREAT | O_TRUNC;
26 } 26 }
27 27
28 if (!open_flags && !(flags & PLATFORM_FILE_OPEN) && 28 if (!open_flags && !(flags & PLATFORM_FILE_OPEN) &&
29 !(flags & PLATFORM_FILE_OPEN_ALWAYS)) { 29 !(flags & PLATFORM_FILE_OPEN_ALWAYS)) {
30 NOTREACHED(); 30 NOTREACHED();
31 errno = ENOTSUP; 31 errno = ENOTSUP;
32 return INVALID_HANDLE_VALUE; 32 return kInvalidPlatformFileValue;
33 } 33 }
34 34
35 if (flags & PLATFORM_FILE_WRITE && flags & PLATFORM_FILE_READ) { 35 if (flags & PLATFORM_FILE_WRITE && flags & PLATFORM_FILE_READ) {
36 open_flags |= O_RDWR; 36 open_flags |= O_RDWR;
37 } else if (flags & PLATFORM_FILE_WRITE) { 37 } else if (flags & PLATFORM_FILE_WRITE) {
38 open_flags |= O_WRONLY; 38 open_flags |= O_WRONLY;
39 } else if (!(flags & PLATFORM_FILE_READ)) { 39 } else if (!(flags & PLATFORM_FILE_READ)) {
40 NOTREACHED(); 40 NOTREACHED();
41 } 41 }
42 42
(...skipping 12 matching lines...) Expand all
55 S_IRUSR | S_IWUSR); 55 S_IRUSR | S_IWUSR);
56 if (created && descriptor > 0) 56 if (created && descriptor > 0)
57 *created = true; 57 *created = true;
58 } 58 }
59 } 59 }
60 60
61 return descriptor; 61 return descriptor;
62 } 62 }
63 63
64 } // namespace base 64 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698