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

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

Issue 154273003: Make std* blocking file-descriptors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update with bug. Created 6 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 | « runtime/bin/platform_win.cc ('k') | runtime/bin/socket_android.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 #include "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 #include "bin/io_buffer.h" 6 #include "bin/io_buffer.h"
7 #include "bin/platform.h" 7 #include "bin/platform.h"
8 #include "bin/process.h" 8 #include "bin/process.h"
9 #include "bin/socket.h" 9 #include "bin/socket.h"
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 Dart_SetReturnValue(args, Dart_NewBoolean(success)); 202 Dart_SetReturnValue(args, Dart_NewBoolean(success));
203 } 203 }
204 204
205 205
206 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { 206 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) {
207 int64_t status = 0; 207 int64_t status = 0;
208 // Ignore result if passing invalid argument and just exit 0. 208 // Ignore result if passing invalid argument and just exit 0.
209 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); 209 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
210 Dart_ExitIsolate(); 210 Dart_ExitIsolate();
211 Dart_Cleanup(); 211 Dart_Cleanup();
212 Platform::Cleanup();
213 exit(static_cast<int>(status)); 212 exit(static_cast<int>(status));
214 } 213 }
215 214
216 215
217 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { 216 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) {
218 int64_t status = 0; 217 int64_t status = 0;
219 // Ignore result if passing invalid argument and just set exit code to 0. 218 // Ignore result if passing invalid argument and just set exit code to 0.
220 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); 219 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
221 Process::SetGlobalExitCode(status); 220 Process::SetGlobalExitCode(status);
222 } 221 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 int external_length = strlen(system_string); 297 int external_length = strlen(system_string);
299 uint8_t* buffer = NULL; 298 uint8_t* buffer = NULL;
300 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer); 299 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer);
301 memmove(buffer, system_string, external_length); 300 memmove(buffer, system_string, external_length);
302 if (utf8 != system_string) free(const_cast<char*>(system_string)); 301 if (utf8 != system_string) free(const_cast<char*>(system_string));
303 Dart_SetReturnValue(args, external_array); 302 Dart_SetReturnValue(args, external_array);
304 } 303 }
305 304
306 } // namespace bin 305 } // namespace bin
307 } // namespace dart 306 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/platform_win.cc ('k') | runtime/bin/socket_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698