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

Side by Side Diff: runtime/bin/file_linux.cc

Issue 9189003: Move assert.h/assert.cc from runtime/vm to runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Check for correct rebase Created 8 years, 11 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 | « runtime/bin/directory.cc ('k') | runtime/bin/file_macos.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/file.h"
6
5 #include <errno.h> 7 #include <errno.h>
6 #include <fcntl.h> 8 #include <fcntl.h>
7 #include <sys/stat.h> 9 #include <sys/stat.h>
8 #include <unistd.h> 10 #include <unistd.h>
9 #include <libgen.h> 11 #include <libgen.h>
10 12
11 #include "bin/builtin.h" 13 #include "bin/builtin.h"
12 #include "bin/file.h"
13 14
14 class FileHandle { 15 class FileHandle {
15 public: 16 public:
16 explicit FileHandle(int fd) : fd_(fd) { } 17 explicit FileHandle(int fd) : fd_(fd) { }
17 ~FileHandle() { } 18 ~FileHandle() { }
18 int fd() const { return fd_; } 19 int fd() const { return fd_; }
19 void set_fd(int fd) { fd_ = fd; } 20 void set_fd(int fd) { fd_ = fd; }
20 21
21 private: 22 private:
22 int fd_; 23 int fd_;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return (pathname != NULL && pathname[0] == '/'); 152 return (pathname != NULL && pathname[0] == '/');
152 } 153 }
153 154
154 155
155 char* File::GetCanonicalPath(const char* pathname) { 156 char* File::GetCanonicalPath(const char* pathname) {
156 char* abs_path = NULL; 157 char* abs_path = NULL;
157 if (pathname != NULL) { 158 if (pathname != NULL) {
158 do { 159 do {
159 abs_path = realpath(pathname, NULL); 160 abs_path = realpath(pathname, NULL);
160 } while (abs_path == NULL && errno == EINTR); 161 } while (abs_path == NULL && errno == EINTR);
161 assert(abs_path == NULL || IsAbsolutePath(abs_path)); 162 ASSERT(abs_path == NULL || IsAbsolutePath(abs_path));
162 } 163 }
163 return abs_path; 164 return abs_path;
164 } 165 }
165 166
166 167
167 const char* File::PathSeparator() { 168 const char* File::PathSeparator() {
168 return "/"; 169 return "/";
169 } 170 }
170 171
171 172
172 const char* File::StringEscapedPathSeparator() { 173 const char* File::StringEscapedPathSeparator() {
173 return "/"; 174 return "/";
174 } 175 }
OLDNEW
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/file_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698