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

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

Issue 2204953002: Don't close stdio/stderr when shutting down. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add comment. Created 4 years, 4 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
« no previous file with comments | « no previous file | runtime/bin/file_linux.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "bin/file.h" 7 #include "bin/file.h"
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 const char* filename = 106 const char* filename =
107 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); 107 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
108 bool exists = File::Exists(filename); 108 bool exists = File::Exists(filename);
109 Dart_SetReturnValue(args, Dart_NewBoolean(exists)); 109 Dart_SetReturnValue(args, Dart_NewBoolean(exists));
110 } 110 }
111 111
112 112
113 void FUNCTION_NAME(File_Close)(Dart_NativeArguments args) { 113 void FUNCTION_NAME(File_Close)(Dart_NativeArguments args) {
114 File* file = GetFile(args); 114 File* file = GetFile(args);
115 ASSERT(file != NULL); 115 ASSERT(file != NULL);
116 file->Close();
116 file->DeleteWeakHandle(Dart_CurrentIsolate()); 117 file->DeleteWeakHandle(Dart_CurrentIsolate());
117 file->Release(); 118 file->Release();
118 119
119 // NULL-out the now potentially dangling pointer. 120 // NULL-out the now potentially dangling pointer.
120 Dart_Handle dart_this = Dart_GetNativeArgument(args, 0); 121 Dart_Handle dart_this = Dart_GetNativeArgument(args, 0);
121 SetFile(dart_this, 0); 122 SetFile(dart_this, 0);
122 Dart_SetReturnValue(args, Dart_NewInteger(0)); 123 Dart_SetReturnValue(args, Dart_NewInteger(0));
123 } 124 }
124 125
125 126
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 return CObject::IllegalArgumentError(); 1230 return CObject::IllegalArgumentError();
1230 } 1231 }
1231 } 1232 }
1232 return CObject::IllegalArgumentError(); 1233 return CObject::IllegalArgumentError();
1233 } 1234 }
1234 1235
1235 } // namespace bin 1236 } // namespace bin
1236 } // namespace dart 1237 } // namespace dart
1237 1238
1238 #endif // !defined(DART_IO_DISABLED) 1239 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698