Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_windows.cc')
-rw-r--r--winsup/cygwin/fhandler_windows.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc
index ac1fe044d..d6b3059e6 100644
--- a/winsup/cygwin/fhandler_windows.cc
+++ b/winsup/cygwin/fhandler_windows.cc
@@ -79,26 +79,25 @@ fhandler_windows::write (const void *buf, size_t)
return SendMessage (ptr->hwnd, ptr->message, ptr->wParam, ptr->lParam);
}
-int __stdcall
-fhandler_windows::read (void *buf, size_t len)
+void __stdcall
+fhandler_windows::read (void *buf, size_t& len)
{
MSG *ptr = (MSG *) buf;
- int ret;
if (len < sizeof (MSG))
{
set_errno (EINVAL);
- return -1;
+ (ssize_t) len = -1;
+ return;
}
- ret = GetMessage (ptr, hWnd_, 0, 0);
+ (ssize_t) len = GetMessage (ptr, hWnd_, 0, 0);
- if (ret == -1)
- {
- __seterrno ();
- }
- set_errno (0);
- return ret;
+ if ((ssize_t) len == -1)
+ __seterrno ();
+ else
+ set_errno (0);
+ return;
}
int