aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-06-15 16:15:37 +0200
committerCorinna Vinschen <corinna@vinschen.de>2015-06-15 16:15:54 +0200
commit95c5a3f6b7821366bec548844ab1bbd63737bf13 (patch)
treed2dd4e8753e3630df0abada5611247cc4f6c78ab /winsup
parent325926031b4f840aa0404cb635766235bfbafebe (diff)
downloadnewlib-95c5a3f6b7821366bec548844ab1bbd63737bf13.zip
newlib-95c5a3f6b7821366bec548844ab1bbd63737bf13.tar.gz
newlib-95c5a3f6b7821366bec548844ab1bbd63737bf13.tar.bz2
Don't enforce SA_RESTART in non-main threads
* exceptions.cc (_cygtls::call_signal_handler): Disable enforcing SA_RESTART in non-main threads to allow returning with EINTR from system calls. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/exceptions.cc7
2 files changed, 12 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8b6ed6a..1eafa28 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * 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 <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 5.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 4a6c21e..7ecac23 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