Skip to content
Browse files

Add killProcess

  • Loading branch information...
1 parent ab7e650 commit c4cdd064d7c154f41a5b2b7f73c6b0ac0b2dccb9 @timthelion committed Mar 2, 2013
Showing with 17 additions and 0 deletions.
  1. +17 −0 cbits/runProcess.c
View
17 cbits/runProcess.c
@@ -234,6 +234,13 @@ terminateProcess (ProcHandle handle)
}
int
+killProcess (ProcHandle handle)
+{
+ return (kill(handle, SIGKILL) == 0);
+}
+
+
+int
getProcessExitCode (ProcHandle handle, int *pExitCode)
{
int wstat, res;
@@ -503,6 +510,16 @@ terminateProcess (ProcHandle handle)
}
int
+killProcess (ProcHandle handle)
+{
+ if (!TerminateProcess((HANDLE) handle, 1)) {
+ maperrno();
+ return -1;
+ }
+ return 0;
+}
+
+int
getProcessExitCode (ProcHandle handle, int *pExitCode)
{
*pExitCode = 0;

0 comments on commit c4cdd06

Please sign in to comment.
Something went wrong with that request. Please try again.