mirror of
https://github.com/janet-lang/janet
synced 2025-02-10 22:00:01 +00:00
Broken Pipe error on windows should just be end of stream.
This commit is contained in:
parent
dc51bd09f7
commit
d199c817dc
@ -1253,7 +1253,11 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
|
|||||||
{
|
{
|
||||||
status = ReadFile(s->stream->handle, state->chunk_buf, chunk_size, NULL, &state->overlapped);
|
status = ReadFile(s->stream->handle, state->chunk_buf, chunk_size, NULL, &state->overlapped);
|
||||||
if (!status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
if (!status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
||||||
janet_cancel(s->fiber, janet_ev_lasterr());
|
if (WSAGetLastError() == ERROR_BROKEN_PIPE) {
|
||||||
|
janet_schedule(s->fiber, janet_wrap_nil());
|
||||||
|
} else {
|
||||||
|
janet_cancel(s->fiber, janet_ev_lasterr());
|
||||||
|
}
|
||||||
return JANET_ASYNC_STATUS_DONE;
|
return JANET_ASYNC_STATUS_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user