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

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

Issue 10545134: Give Process.kill an optional argument to specify which signal to send. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes based on ager's review. Created 8 years, 6 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
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/dartutils.h" 5 #include "bin/dartutils.h"
6 #include "bin/process.h" 6 #include "bin/process.h"
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 // Extract an array of C strings from a list of Dart strings. 10 // Extract an array of C strings from a list of Dart strings.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 delete[] string_args; 140 delete[] string_args;
141 delete[] string_environment; 141 delete[] string_environment;
142 Dart_SetReturnValue(args, Dart_NewBoolean(error_code == 0)); 142 Dart_SetReturnValue(args, Dart_NewBoolean(error_code == 0));
143 Dart_ExitScope(); 143 Dart_ExitScope();
144 } 144 }
145 145
146 146
147 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) { 147 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) {
148 Dart_EnterScope(); 148 Dart_EnterScope();
149 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1)); 149 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
150 bool success = Process::Kill(pid); 150 int signal = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2));
151 bool success = Process::Kill(pid, signal);
151 Dart_SetReturnValue(args, Dart_NewBoolean(success)); 152 Dart_SetReturnValue(args, Dart_NewBoolean(success));
152 Dart_ExitScope(); 153 Dart_ExitScope();
153 } 154 }
OLDNEW
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process.dart » ('j') | runtime/bin/process.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698