Skip to content

Commit

Permalink
Removes cmd line string concat
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Vasquez <[email protected]>
  • Loading branch information
rafvasq committed Oct 31, 2023
1 parent c3f018f commit 3764334
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ public static int getPID(Process process) throws Exception {
}

public static int killProcess(Process process) throws Exception {
int pid = getPID(process);
return Runtime.getRuntime().exec("kill -9 " + pid).waitFor();
String pid = Integer.toString(getPID(process));
String command = "kill -9";
return Runtime.getRuntime().exec(new String[] {command, pid}).waitFor();
}
}

0 comments on commit 3764334

Please sign in to comment.