diff options
author | Christopher Faylor <me@cgf.cx> | 2013-01-11 15:36:40 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-01-11 15:36:40 +0000 |
commit | 2f47bbd55583be9b24bee039e6b7f35e3727b8de (patch) | |
tree | bb9cd528ba8480fd8d40977ffb54727b28fc1a67 /winsup/cygwin/select.cc | |
parent | 0ad26aec5b71b1b4c8ebf9c7b395cc3d0d89c18f (diff) | |
download | cygnal-2f47bbd55583be9b24bee039e6b7f35e3727b8de.tar.gz cygnal-2f47bbd55583be9b24bee039e6b7f35e3727b8de.tar.bz2 cygnal-2f47bbd55583be9b24bee039e6b7f35e3727b8de.zip |
* DevNotes: Add entry cgf-000021.
* select.cc (select): Unconditionally return when a signal is detected.
(select_stuff::wait): Ditto.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r-- | winsup/cygwin/select.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 143e8c4e7..4286c1543 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, 2012 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc. This file is part of Cygwin. @@ -165,13 +165,12 @@ select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, { case WAIT_SIGNALED: select_printf ("signal received"); - if (_my_tls.call_signal_handler ()) - res = select_stuff::select_loop; /* Emulate linux behavior */ - else - { - set_sig_errno (EINTR); - res = select_stuff::select_error; - } + /* select() is always interrupted by a signal so set EINTR, + unconditionally, ignoring any SA_RESTART detection by + call_signal_handler(). */ + _my_tls.call_signal_handler (); + set_sig_errno (EINTR); + res = select_stuff::select_signalled; break; case WAIT_CANCELED: sel.destroy (); @@ -404,13 +403,12 @@ next_while:; be assured that a signal handler won't jump out of select entirely. */ cleanup (); destroy (); - if (_my_tls.call_signal_handler ()) - res = select_loop; - else - { - set_sig_errno (EINTR); - res = select_signalled; /* Cause loop exit in cygwin_select */ - } + /* select() is always interrupted by a signal so set EINTR, + unconditionally, ignoring any SA_RESTART detection by + call_signal_handler(). */ + _my_tls.call_signal_handler (); + set_sig_errno (EINTR); + res = select_signalled; /* Cause loop exit in cygwin_select */ break; case WAIT_FAILED: system_printf ("WaitForMultipleObjects failed, %E"); |