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 10, 2018
1 parent e92950b commit 69aab24
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -192,6 +192,20 @@ protected boolean isPidRunning(int pid) {
Process proc = pb.start();
proc.getOutputStream().close();
BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader stderr = new BufferedReader(new InputStreamReader(proc.getErrorStream()));

new Thread(new Runnable() {
@Override
public void run() {
try {
while (stderr.read() != -1) {
}
} catch (IOException e) {
e.printStackTrace();
}
}
}).start();

String line = null, curLine = null;
boolean isHeaderLine = true;
while ((curLine = stdout.readLine()) != null && line == null) {
Expand Down

0 comments on commit 69aab24

Please sign in to comment.