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

Unified Diff: runtime/bin/process.cc

Issue 890633002: Add an option for starting a detached process with stdio connected (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process.cc
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 0f3e5bc0881d06ccb3eb46f0d11a242070b09c24..561ffe4f3f76e8612b02b5b5a9412dac131031fd 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -118,7 +118,8 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
return;
}
}
- bool detached = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 5));
+ int64_t mode =
+ DartUtils::GetInt64ValueCheckRange(Dart_GetNativeArgument(args, 5), 0, 2);
Dart_Handle stdin_handle = Dart_GetNativeArgument(args, 6);
Dart_Handle stdout_handle = Dart_GetNativeArgument(args, 7);
Dart_Handle stderr_handle = Dart_GetNativeArgument(args, 8);
@@ -132,7 +133,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
working_directory,
string_environment,
environment_length,
- detached,
+ static_cast<ProcessStartMode>(mode),
&process_stdout,
&process_stdin,
&process_stderr,
@@ -140,10 +141,12 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
&exit_event,
&os_error_message);
if (error_code == 0) {
- if (!detached) {
+ if (mode != kDetached) {
Socket::SetSocketIdNativeField(stdin_handle, process_stdin);
Socket::SetSocketIdNativeField(stdout_handle, process_stdout);
Socket::SetSocketIdNativeField(stderr_handle, process_stderr);
+ }
+ if (mode == kNormal) {
Socket::SetSocketIdNativeField(exit_handle, exit_event);
}
Process::SetProcessIdNativeField(process, pid);
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698