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:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-01 18:35:12 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-05-01 18:35:12 +0400
commit79e741ef6f0882f993e4b0767cc62b6b417f30cd (patch)
treef5465cbddbd551b0bb6d4699beb96427e76cfc85 /winsup/cygwin/select.cc
parentc60d0bbe688ae9ad37e56ab8ba73124e8b6c73b7 (diff)
Throughout, use user32 UNICODE functions rather than ANSI functions.
* autoload.cc: Convert all definitions for ANSI user32 functions to definitions for the corresponding UNICODE function. (SendMessageA): Remove. (SendNotifyMessageW): Define. * fhandler_windows.cc (fhandler_windows::write): Use SendNotifyMessageW call rather than SendMessage to make function always return immediately. (fhandler_windows::read): Make function interruptible and a cancellation point. Handle O_NONBLOCK. * select.cc (peek_serial): Don't wait for signal_arrived here. * window.cc (wininfo::winthread): Call CreateWindowExW directly rather than CreateWindow wrapper.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index b3d33c68d..57eb2946d 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1055,14 +1055,7 @@ peek_serial (select_record *s, bool)
}
}
- HANDLE w4[2];
- DWORD to;
-
- w4[0] = fh->io_status.hEvent;
- w4[1] = signal_arrived;
- to = 10;
-
- switch (WaitForMultipleObjects (2, w4, FALSE, to))
+ switch (WaitForSingleObject (fh->io_status.hEvent, 10L))
{
case WAIT_OBJECT_0:
if (!ClearCommError (h, &fh->ev, &st))
@@ -1071,18 +1064,13 @@ peek_serial (select_record *s, bool)
goto err;
}
else if (!st.cbInQue)
- Sleep (to);
+ Sleep (10L);
else
{
return s->read_ready = true;
select_printf ("got something");
}
break;
- case WAIT_OBJECT_0 + 1:
- select_printf ("interrupt");
- set_sig_errno (EINTR);
- ready = -1;
- break;
case WAIT_TIMEOUT:
break;
default:
@@ -1547,7 +1535,7 @@ peek_windows (select_record *me, bool)
if (me->read_selected && me->read_ready)
return 1;
- if (PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE))
+ if (PeekMessageW (&m, (HWND) h, 0, 0, PM_NOREMOVE))
{
me->read_ready = true;
select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ());