Author: abidh Date: Thu Dec 4 05:05:31 2014 New Revision: 223353 URL: http://llvm.org/viewvc/llvm-project?rev=223353&view=rev Log: Cleanup of the fix done recently for a lldb-mi hang on OSX. It was observed that we dont need to set stdin to unbuffered and setting console to non-canonical mode.
Patch originally came from "Ilia K <[email protected]>" Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp Modified: lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp?rev=223353&r1=223352&r2=223353&view=diff ============================================================================== --- lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnStreamStdinLinux.cpp Thu Dec 4 05:05:31 2014 @@ -161,23 +161,14 @@ CMICmnStreamStdinLinux::InputAvailable(b // Although this problem was not observed on Linux. // A solution based on 'select' was also proposed but it seems to slow things down // a lot. - static bool bInitialized = false; - - if (!bInitialized) + int nBytesWaiting; + if (::ioctl(STDIN_FILENO, FIONREAD, &nBytesWaiting) == -1) { - // Use termios to turn off line buffering - ::termios term; - ::tcgetattr(STDIN_FILENO, &term); - term.c_lflag &= ~ICANON; - ::tcsetattr(STDIN_FILENO, TCSANOW, &term); - ::setbuf(stdin, NULL); - bInitialized = true; + vwbAvail = false; + return MIstatus::failure;; } - - int nBytesWaiting; - ::ioctl(STDIN_FILENO, FIONREAD, &nBytesWaiting); vwbAvail = (nBytesWaiting > 0); -#endif +#endif // !defined( _WIN32 ) return MIstatus::success; } _______________________________________________ lldb-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
