Skip to content

Commit

Permalink
0003510: Service wrapper hanging on start on Windows 2003 server
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Apr 9, 2018
1 parent 6dc7ee2 commit e92950b
Showing 1 changed file with 8 additions and 15 deletions.
Expand Up @@ -23,7 +23,6 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -194,23 +193,17 @@ protected boolean isPidRunning(int pid) {
proc.getOutputStream().close();
BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line = null, curLine = null;
curLine = stdout.readLine();
if (curLine != null && !curLine.trim().equals("")) {
while ((curLine = stdout.readLine()) != null) {
if (line == null && !curLine.trim().equals("")) {
line = curLine;
break;
}
boolean isHeaderLine = true;
while ((curLine = stdout.readLine()) != null && line == null) {
System.out.println(curLine);
if (isHeaderLine) {
isHeaderLine = false;
} else if (line == null && !curLine.trim().equals("")) {
line = curLine;
}
}
while (stdout.read() != -1) {
}
stdout.close();
InputStream errout = proc.getErrorStream();
while (errout.read() != -1) {
}
errout.close();


if (line != null) {
String[] array = line.split("\\s+");
if (array.length > 0) {
Expand Down

0 comments on commit e92950b

Please sign in to comment.