Skip to content

Commit d021e5a

Browse files
committed
fix(stream): fixing the output stream to be drained in eim check for gui
1 parent c74b797 commit d021e5a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import java.io.File;
88
import java.io.IOException;
9+
import java.io.OutputStream;
910
import java.nio.file.Files;
1011
import java.nio.file.Path;
1112
import java.nio.file.Paths;
@@ -276,6 +277,8 @@ public boolean isEimGuiCapable(String eimPath)
276277
Logger.log("Checking if EIM supports GUI mode with command: " + String.join(" ", pb.command())); //$NON-NLS-1$ //$NON-NLS-2$
277278
pb.redirectErrorStream(true);
278279
Process process = pb.start();
280+
// Drain stdout so the process doesn't block
281+
process.getInputStream().transferTo(OutputStream.nullOutputStream());
279282
boolean finished = process.waitFor(5, TimeUnit.SECONDS);
280283
if (!finished)
281284
{

0 commit comments

Comments
 (0)