[wing/wip/nacho/poll-stream] Set G_IO_ERROR_WOULD_BLOCK error
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [wing/wip/nacho/poll-stream] Set G_IO_ERROR_WOULD_BLOCK error
- Date: Wed, 28 Nov 2018 15:36:48 +0000 (UTC)
commit 520731c2e7f71100f1110d02a24662e6afc0958e
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Wed Nov 28 16:33:25 2018 +0100
Set G_IO_ERROR_WOULD_BLOCK error
wing/winginputstream.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/wing/winginputstream.c b/wing/winginputstream.c
index 83886ce..44c3fa1 100644
--- a/wing/winginputstream.c
+++ b/wing/winginputstream.c
@@ -158,12 +158,19 @@ read_internal (GInputStream *stream,
if (errsv == ERROR_IO_PENDING)
{
- if (!blocking ||
- blocking && wing_overlap_wait_result (win32_stream->priv->handle,
+ if (!blocking)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK,
+ g_strerror (EAGAIN));
+ goto end;
+ }
+ else if (blocking && wing_overlap_wait_result (win32_stream->priv->handle,
&priv->overlap,
&nread, cancellable))
- retval = nread;
- goto end;
+ {
+ retval = nread;
+ goto end;
+ }
}
if (g_cancellable_set_error_if_cancelled (cancellable, error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]