[openssh-commits] [openssh] 01/01: Re-add SA_RESTART to mysignal.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Oct 11 14:19:17 AEDT 2019


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 9b9e3ca6945351eefb821ff783a4a8e6d9b98b9a
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Oct 11 14:12:16 2019 +1100

    Re-add SA_RESTART to mysignal.
    
    This makes mysignal implement reliable BSD semantics according to
    Stevens' APUE.  This was first attempted in 2001 but was reverted
    due to problems with HP-UX 10.20 and select() and possibly grantpt().
    Modern systems should be fine with it, but if any current platforms have
    a problem with it now we can disable it just for those.  ok djm@
---
 openbsd-compat/bsd-signal.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/openbsd-compat/bsd-signal.c b/openbsd-compat/bsd-signal.c
index 0b816a3a..104ab653 100644
--- a/openbsd-compat/bsd-signal.c
+++ b/openbsd-compat/bsd-signal.c
@@ -37,10 +37,15 @@ mysignal(int sig, mysig_t act)
 		memset(&sa, 0, sizeof(sa));
 		sigemptyset(&sa.sa_mask);
 		sa.sa_flags = 0;
+		if (sig == SIGALRM) {
 #ifdef SA_INTERRUPT
-		if (sig == SIGALRM)
 			sa.sa_flags |= SA_INTERRUPT;
 #endif
+		} else {
+#ifdef SA_RESTART
+			sa.sa_flags |= SA_RESTART;
+#endif
+		}
 		sa.sa_handler = act;
 		if (sigaction(sig, &sa, NULL) == -1)
 			return (mysig_t) -1;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list