diff options
author | Christopher Faylor <me@cgf.cx> | 2012-01-22 06:45:08 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-01-22 06:45:08 +0000 |
commit | ad87edbe61a324a67be86eb0d2efafa4d52b4a6f (patch) | |
tree | 45e0686a448bf1c0cd937290ba8ab769f213a619 /winsup/cygwin/select.cc | |
parent | 5259273091c45c6338e3452f8571f32884f385e4 (diff) | |
download | cygnal-ad87edbe61a324a67be86eb0d2efafa4d52b4a6f.tar.gz cygnal-ad87edbe61a324a67be86eb0d2efafa4d52b4a6f.tar.bz2 cygnal-ad87edbe61a324a67be86eb0d2efafa4d52b4a6f.zip |
* cygheap.h (cygheap_fdget::~cygheap_fdget): Simplify now that refcnt reports
reference count changes itself.
* fhandler.cc (fhandler_base::reset): Set _refcnt to 0.
* fhandler.h (fhandler_base::refcnt): Report refcnt when debugging.
* select.cc (cygwin_select): Set return_on_signal to indicate when select
should be interrupted.
(select_stuff::wait): Keep looping unless return_on_signal is set.
* select.h (select_stuff::return_on_signal): New variable.
(select_stuff::select_stuff): Zero return_on_signal.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r-- | winsup/cygwin/select.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 52e2eabd5..ff63b1e5e 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -1,7 +1,7 @@ /* select.cc Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -130,16 +130,17 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, fd_set *e = allocfd_set (maxfds); int res = 0; + sel.return_on_signal = &_my_tls == _main_tls; /* Degenerate case. No fds to wait for. Just wait. */ if (sel.start.next == NULL) while (!res) switch (cygwait (ms)) { case WAIT_OBJECT_0: + select_printf ("signal received"); _my_tls.call_signal_handler (); - if (&_my_tls != _main_tls) + if (!sel.return_on_signal) continue; /* Emulate linux behavior */ - select_printf ("signal received"); set_sig_errno (EINTR); res = -1; break; @@ -328,8 +329,11 @@ select_stuff::wait (fd_set *readfds, fd_set *writefds, fd_set *exceptfds, switch (wait_ret) { case WAIT_OBJECT_0: - cleanup (); select_printf ("signal received"); + _my_tls.call_signal_handler (); + if (!return_on_signal) + continue; /* Emulate linux behavior */ + cleanup (); set_sig_errno (EINTR); return -1; case WAIT_OBJECT_0 + 1: |