mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 11:09:54 +00:00
Invert status check for (Read/Write)File
This commit is contained in:
parent
7a98f9aa02
commit
139e3fab25
@ -1252,7 +1252,7 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
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());
|
janet_cancel(s->fiber, janet_ev_lasterr());
|
||||||
return JANET_ASYNC_STATUS_DONE;
|
return JANET_ASYNC_STATUS_DONE;
|
||||||
}
|
}
|
||||||
@ -1470,7 +1470,7 @@ JanetAsyncStatus ev_machine_write(JanetListenerState *s, JanetAsyncEvent event)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
status = WriteFile(s->stream->handle, bytes, len, NULL, &state->overlapped);
|
status = WriteFile(s->stream->handle, bytes, len, NULL, &state->overlapped);
|
||||||
if (status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
if (!status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
||||||
janet_cancel(s->fiber, janet_ev_lasterr());
|
janet_cancel(s->fiber, janet_ev_lasterr());
|
||||||
return JANET_ASYNC_STATUS_DONE;
|
return JANET_ASYNC_STATUS_DONE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user