# HG changeset patch # User timkelly # Date 1265909482 21600 # Node ID c6f86d0867c23244bb99e471ed57391c42916b49 # Parent bbee10bb6733106e0787781df5adf356c67a2a8f Fix Bug 10467 - Carbide features cannot be used if SBS hangs or is corrupt diff -r bbee10bb6733 -r c6f86d0867c2 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Wed Feb 10 15:19:41 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Thu Feb 11 11:31:22 2010 -0600 @@ -981,10 +981,26 @@ BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String overallOutput = null; String stdErrLine = null; - try { - while ((stdErrLine = br.readLine()) != null) { - overallOutput += stdErrLine; + try { + + // Only try for 10 seconds then bail in case Raptor hangs + int maxTries = 20; + int numTries = 0; + while (numTries < maxTries) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + // ignore + } + if (br.ready()) { + while ((stdErrLine = br.readLine()) != null) { + overallOutput += stdErrLine; + } + break; + } + numTries++; } + } catch (IOException e) { e.printStackTrace(); }