Fix Windows client for EOF on stdin
stdin_read_thread() went into a tight loop on EOF. Observed with
Wine. Broken in commit f082ef9f
, v4.3.11.
This commit is contained in:
parent
041066ab76
commit
e3cee85f7c
1 changed files with 6 additions and 12 deletions
|
@ -136,21 +136,15 @@ static DWORD WINAPI
|
||||||
stdin_read_thread(LPVOID lpParam)
|
stdin_read_thread(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (WaitForSingleObject(bounce_empty, INFINITE) != WAIT_OBJECT_0)
|
if (WaitForSingleObject(bounce_empty, INFINITE) != WAIT_OBJECT_0) {
|
||||||
break;
|
bounce_status = 0;
|
||||||
bounce_status = _read(0, bounce_buf, sizeof(bounce_buf));
|
bounce_error = GetLastError();
|
||||||
bounce_error = errno;
|
} else {
|
||||||
if (bounce_status == 0) {
|
bounce_status = _read(0, bounce_buf, sizeof(bounce_buf));
|
||||||
if (_isatty(0)) {
|
bounce_error = errno;
|
||||||
SetEvent(bounce_empty);
|
|
||||||
continue;
|
|
||||||
} else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
SetEvent(bounce_full);
|
SetEvent(bounce_full);
|
||||||
}
|
}
|
||||||
SetEvent(bounce_full);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue