add more logs to identify #480 root cause; trying to fix

This commit is contained in:
Vadim Lopatin 2017-10-12 12:29:33 +03:00
parent da4285e697
commit cc85663ac3
2 changed files with 15 additions and 3 deletions

View File

@ -232,11 +232,15 @@ class ConsolePlatform : Platform {
* When returned from this method, application is shutting down.
*/
override int enterMessageLoop() {
Log.i("Entered message loop");
while (_console.pollInput()) {
if (_windowList.length == 0)
if (_windowList.length == 0) {
Log.d("Window count is 0 - exiting message loop");
break;
}
}
// TODO
Log.i("Exiting from message loop");
return 0;
}
private dstring _clipboardText;

View File

@ -290,7 +290,15 @@ class Console {
import core.stdc.errno;
int res = cast(int)write(STDOUT_FILENO, s.ptr, s.length);
if (res < 0) {
Log.e("rawWrite error ", errno, " - stopping terminal");
auto err = errno;
while (err == EAGAIN) {
debug Log.d("rawWrite error EAGAIN - will retry");
res = cast(int)write(STDOUT_FILENO, s.ptr, s.length);
if (res >= 0)
return (res > 0);
err = errno;
}
Log.e("rawWrite error ", err, " - stopping terminal");
_stopped = true;
}
return (res > 0);