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

Unified Diff: runtime/bin/process.cc

Issue 798743004: Add support for starting a detached process (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_linux.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 fecb5aa500abaf990416dfed205cdc54cd9a34a8..52035301c3877989d9e5defa62bc1a87cf503dcb 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -65,7 +65,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
intptr_t process_stdout;
intptr_t process_stderr;
intptr_t exit_event;
- Dart_Handle status_handle = Dart_GetNativeArgument(args, 9);
+ Dart_Handle status_handle = Dart_GetNativeArgument(args, 10);
Dart_Handle path_handle = Dart_GetNativeArgument(args, 1);
// The Dart code verifies that the path implements the String
// interface. However, only builtin Strings are handled by
@@ -118,10 +118,11 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
return;
}
}
- Dart_Handle stdin_handle = Dart_GetNativeArgument(args, 5);
- Dart_Handle stdout_handle = Dart_GetNativeArgument(args, 6);
- Dart_Handle stderr_handle = Dart_GetNativeArgument(args, 7);
- Dart_Handle exit_handle = Dart_GetNativeArgument(args, 8);
+ bool detached = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 5));
+ Dart_Handle stdin_handle = Dart_GetNativeArgument(args, 6);
+ Dart_Handle stdout_handle = Dart_GetNativeArgument(args, 7);
+ Dart_Handle stderr_handle = Dart_GetNativeArgument(args, 8);
+ Dart_Handle exit_handle = Dart_GetNativeArgument(args, 9);
intptr_t pid = -1;
char* os_error_message = NULL;
@@ -131,6 +132,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
working_directory,
string_environment,
environment_length,
+ detached,
&process_stdout,
&process_stdin,
&process_stderr,
@@ -138,10 +140,12 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
&exit_event,
&os_error_message);
if (error_code == 0) {
- Socket::SetSocketIdNativeField(stdin_handle, process_stdin);
- Socket::SetSocketIdNativeField(stdout_handle, process_stdout);
- Socket::SetSocketIdNativeField(stderr_handle, process_stderr);
- Socket::SetSocketIdNativeField(exit_handle, exit_event);
+ if (!detached) {
+ Socket::SetSocketIdNativeField(stdin_handle, process_stdin);
+ Socket::SetSocketIdNativeField(stdout_handle, process_stdout);
+ Socket::SetSocketIdNativeField(stderr_handle, process_stderr);
+ Socket::SetSocketIdNativeField(exit_handle, exit_event);
+ }
Process::SetProcessIdNativeField(process, pid);
} else {
DartUtils::SetIntegerField(
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698