summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/internal/ptycon_ntaio_impl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/internal/ptycon_ntaio_impl.c b/src/internal/ptycon_ntaio_impl.c
index 4ab5ca4..cf3f1ea 100644
--- a/src/internal/ptycon_ntaio_impl.c
+++ b/src/internal/ptycon_ntaio_impl.c
@@ -110,13 +110,20 @@ int ptyc_write(int fd, const void * buf, size_t size)
0,0);
/* wait */
- if (status == NT_STATUS_PENDING)
- status = ptyc_ntapi->zw_wait_for_single_object(
- hevent,0,0);
+ switch (status) {
+ case NT_STATUS_PENDING:
+ status = ptyc_ntapi->zw_wait_for_single_object(
+ hevent,0,0);
+ break;
+
+ default:
+ iosb.status = status;
+ break;
+ }
/* hevent */
ptyc_ntapi->zw_close(hevent);
/* ret */
- return status ? status : iosb.status;
+ return iosb.status ? iosb.status : iosb.info;
}