Skip to content
Snippets Groups Projects
Commit e4d64bf4 authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix: Close stdin of 'bzip2' subprocess.

parent 62a41570
No related branches found
No related tags found
No related merge requests found
...@@ -259,12 +259,15 @@ public class RCompression { ...@@ -259,12 +259,15 @@ public class RCompression {
Process p = pb.start(); Process p = pb.start();
// version is written to the error output stream // version is written to the error output stream
InputStream is = p.getErrorStream(); InputStream is = p.getErrorStream();
OutputStream os = p.getOutputStream();
ProcessOutputManager.OutputThreadVariable readThread = new ProcessOutputManager.OutputThreadVariable(command[0], is); ProcessOutputManager.OutputThreadVariable readThread = new ProcessOutputManager.OutputThreadVariable(command[0], is);
readThread.start(); readThread.start();
os.close();
try { try {
rc = p.waitFor(); rc = p.waitFor();
if (rc == 0) { if (rc == 0) {
String output = new String(readThread.getData()); readThread.join();
String output = new String(readThread.getData(), 0, readThread.getTotalRead());
String version = "Version "; String version = "Version ";
String firstLine = output.split("\\n")[0]; String firstLine = output.split("\\n")[0];
int versionIdx = firstLine.indexOf(version); int versionIdx = firstLine.indexOf(version);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment