diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8b6ed6aec..1eafa28c5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-06-15 Corinna Vinschen + + * exceptions.cc (_cygtls::call_signal_handler): Disable enforcing + SA_RESTART in non-main threads to allow returning with EINTR from + system calls. + 2015-06-11 Corinna Vinschen * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 5. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 4a6c21e7c..7ecac23ab 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1542,7 +1542,12 @@ _cygtls::call_signal_handler () set_errno (this_errno); } - return this_sa_flags & SA_RESTART || (this != _main_tls); + /* FIXME: Since 2011 this return statement always returned 1 (meaning + SA_RESTART is effective) if the thread we're running in is not the + main thread. We're disabling this check to enable EINTR behaviour + on system calls not running in the main thread. It's not quite clear + if that has undesired side-effects, therefore this comment. */ + return this_sa_flags & SA_RESTART; } void