summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_serial.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-06-17 20:50:24 +0000
committerChristopher Faylor <me@cgf.cx>2012-06-17 20:50:24 +0000
commit4ae63783821bd2114246166957d25b2acd26c875 (patch)
tree0b7972e9330fa3a3f863621afd18643e485a151f /winsup/cygwin/fhandler_serial.cc
parentd66ef282c2473d7df911e6d7d6ef1fc778777097 (diff)
downloadcygnal-4ae63783821bd2114246166957d25b2acd26c875.tar.gz
cygnal-4ae63783821bd2114246166957d25b2acd26c875.tar.bz2
cygnal-4ae63783821bd2114246166957d25b2acd26c875.zip
Add '#include "cygwait.h"' throughout, where appropriate.
* DevNotes: Add entry cgf-000012. * Makefile.in (DLL_OFILES): Add cygwait.o. * sigproc.h: Remove cygwait definitions. * cygwait.h: New file. Define/declare Cygwin waitfor functions. * cygwait.cc: Ditto. * exceptions.cc: Include cygwait.h. (handle_sigsuspend): Accommodate change in cancelable_wait arguments. (sigpacket::process): Display thread tls in debugging output. * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic names for signal and cancel return. * fhandler_console.cc (fhandler_console::read): Ditto. (fhandler_dev_dsp::Audio_out::waitforspace): Ditto. fhandler_dev_dsp::Audio_in::waitfordata): Ditto. * fhandler_fifo.cc (fhandler_fifo::wait): Ditto. * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. * fhandler_tty.cc (fhandler_pty_slave::read): Ditto. * select.cc (cygwin_select): Ditto. * wait.cc (wait4): Ditto. * thread.cc (cancelable_wait): Move definition to cygwait.h. (pthread_cond::wait): Accommodate change in cancelable_wait arguments. (pthread_mutex::lock): Ditto. (pthread_spinlock::lock): Ditto. (pthread::join): Ditto. (pthread::thread_init_wrapper): Display tls in debugging output. (semaphore::_timedwait): Ditto. * thread.h (cw_sig_wait): Move to cygwait.h. (cw_cancel_action): Delete. (cancelable_wait): Move declaration to cygwait.h.
Diffstat (limited to 'winsup/cygwin/fhandler_serial.cc')
-rw-r--r--winsup/cygwin/fhandler_serial.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index 033498742..c9a18c3d9 100644
--- a/winsup/cygwin/fhandler_serial.cc
+++ b/winsup/cygwin/fhandler_serial.cc
@@ -20,6 +20,7 @@ details. */
#include "pinfo.h"
#include <asm/socket.h>
#include <ddk/ntddser.h>
+#include "cygwait.h"
/**********************************************************************/
/* fhandler_serial */
@@ -94,13 +95,13 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
goto err;
debug_printf ("n %d, ev %x", n, ev);
break;
- case WAIT_OBJECT_0 + 1:
+ case WAIT_SIGNALED:
tot = -1;
PurgeComm (get_handle (), PURGE_RXABORT);
overlapped_armed = 0;
set_sig_errno (EINTR);
goto out;
- case WAIT_OBJECT_0 + 2:
+ case WAIT_CANCELED:
PurgeComm (get_handle (), PURGE_RXABORT);
overlapped_armed = 0;
pthread::static_cancel_self ();
@@ -201,12 +202,12 @@ fhandler_serial::raw_write (const void *ptr, size_t len)
{
case WAIT_OBJECT_0:
break;
- case WAIT_OBJECT_0 + 1:
+ case WAIT_SIGNALED:
PurgeComm (get_handle (), PURGE_TXABORT);
set_sig_errno (EINTR);
ForceCloseHandle (write_status.hEvent);
return -1;
- case WAIT_OBJECT_0 + 2:
+ case WAIT_CANCELED:
PurgeComm (get_handle (), PURGE_TXABORT);
pthread::static_cancel_self ();
/*NOTREACHED*/