From 8bce0d723c50924b908dca1467037c8008e872be Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 14 Dec 2002 04:01:32 +0000 Subject: Throughout, change fhandler_*::read and fhandler_*::raw_read to void functions whose second arguments are both the lenght and the return value. * fhandler.cc (fhandler_base::read): Rework slightly to use second argument as input/output. Tweak CRLF stuff. (fhandler_base::readv): Accommodate fhandler_*::read changes. * cygthread.h (cygthread::detach): Declare as taking optional handle argument. (cygthread::detach): When given a handle argument, wait for the handle to be signalled before waiting for thread to detach. Return true when signal detected. --- winsup/cygwin/fhandler_windows.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'winsup/cygwin/fhandler_windows.cc') 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 -- cgit v1.2.3