diff options
Diffstat (limited to 'src/console/ptyc_console_poller.c')
-rw-r--r-- | src/console/ptyc_console_poller.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/console/ptyc_console_poller.c b/src/console/ptyc_console_poller.c index 7f63197..7aec73d 100644 --- a/src/console/ptyc_console_poller.c +++ b/src/console/ptyc_console_poller.c @@ -17,6 +17,7 @@ int __stdcall ptyc_console_poller(struct ptyc_driver_ctx_impl * ictx) int32_t status; int32_t iostatus; struct ptyc_term_ctx * tctx; + struct ptyc_driver_ctx * dctx; nt_tty_sigctl_info ctlinfo; void * hwnd; void * hevent; @@ -27,6 +28,7 @@ int __stdcall ptyc_console_poller(struct ptyc_driver_ctx_impl * ictx) int diff; tctx = &ictx->tctx; + dctx = &ictx->ctx; if (!(hwnd = ntcon->get_console_window())) return NT_STATUS_INTERNAL_ERROR; @@ -89,7 +91,9 @@ int __stdcall ptyc_console_poller(struct ptyc_driver_ctx_impl * ictx) &ctlinfo,sizeof(ctlinfo)))) return iostatus; } - } while (status == NT_STATUS_TIMEOUT); + } while ((status == NT_STATUS_TIMEOUT) && (dctx->status == NT_STATUS_SUCCESS)); - return NT_STATUS_INTERNAL_ERROR; + return (dctx->status == NT_STATUS_PIPE_DISCONNECTED) + ? NT_STATUS_SUCCESS + : dctx->status ? dctx->status : status; } |