Skip to content

Commit

Permalink
Merge pull request #202 from mygizli04/master
Browse files Browse the repository at this point in the history
Change the command used for process detection on macOS
  • Loading branch information
mircokroon authored Aug 25, 2021
2 parents a5ef864 + c54450d commit d4eebeb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/proxy/auth/AuthDetailsFromProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ private List<Long> findJavawProcessWindows() throws IOException {
* header that we can read out to get the required index for the arguments.
*/
private List<String> findCandidateProcessUnix() throws IOException {
Process p = Runtime.getRuntime().exec("ps -fC java");
Process p;
if (SystemUtils.IS_OS_MAC_OSX) {
p = Runtime.getRuntime().exec("ps ax");
}
else {
p = Runtime.getRuntime().exec("ps -fC java");
}

BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));

Expand Down

0 comments on commit d4eebeb

Please sign in to comment.