diff options
author | Christopher Faylor <me@cgf.cx> | 2011-12-04 22:32:00 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-12-04 22:32:00 +0400 |
commit | 79e59d522afe5692c09ab21eade08947eca3ec19 (patch) | |
tree | cd44280ba1c10616a5bb8d19ed01f2681d75045c /winsup/cygwin/sigproc.h | |
parent | 4510afa90d42eec08a2ec91f4203ed126ab998c8 (diff) |
* sigproc.cc (cygWFMO): Don't assume that cancellable event is always
available.
* fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::waitforspace): Use cygWFMO
instead of WaitForMultipleObjects.
(fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
(fhandler_serial::raw_write): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::read): Ditto.
* select.cc (cygwin_select): Ditto for degenerate case.
Diffstat (limited to 'winsup/cygwin/sigproc.h')
-rw-r--r-- | winsup/cygwin/sigproc.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 2c027a9e4..21293ccb9 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -88,11 +88,12 @@ DWORD cygWFMO (DWORD n, DWORD howlong, ...) va_start (ap, howlong); HANDLE w4[n + 2]; va_start (ap, howlong); - unsigned i; - for (i = 0; i < n; i++) + for (unsigned i = 0; i < n; i++) w4[i] = va_arg (ap, HANDLE); - w4[i++] = signal_arrived; - w4[i++] = pthread::get_cancel_event (); + w4[n++] = signal_arrived; + w4[n++] = pthread::get_cancel_event (); + if (!w4[n - 1]) + n--; return WaitForMultipleObjects (n, w4, FALSE, howlong); } #endif |