Skip to content

Commit fd68f26

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

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;
@@ -275,6 +276,8 @@ public boolean isEimGuiCapable(String eimPath)
275276
Logger.log("Checking if EIM supports GUI mode with command: " + String.join(" ", pb.command())); //$NON-NLS-1$ //$NON-NLS-2$
276277
pb.redirectErrorStream(true);
277278
Process process = pb.start();
279+
// Drain stdout so the process doesn't block
280+
process.getInputStream().transferTo(OutputStream.nullOutputStream());
278281
boolean finished = process.waitFor(5, TimeUnit.SECONDS);
279282
if (!finished)
280283
{

0 commit comments

Comments
 (0)