[openssh-commits] [openssh] 03/03: Remove mysignal wrapper.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Jan 23 18:56:33 AEDT 2020


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

dtucker pushed a commit to branch master
in repository openssh.

commit 84226b447d45fe4542613de68c2ca59a890d7c01
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Thu Jan 23 18:55:24 2020 +1100

    Remove mysignal wrapper.
    
    We switched the main code to use sigaction(), so the wrapper is no
    longer used.
---
 openbsd-compat/bsd-signal.c | 33 ---------------------------------
 openbsd-compat/bsd-signal.h |  5 -----
 2 files changed, 38 deletions(-)

diff --git a/openbsd-compat/bsd-signal.c b/openbsd-compat/bsd-signal.c
index 104ab653..38d5e972 100644
--- a/openbsd-compat/bsd-signal.c
+++ b/openbsd-compat/bsd-signal.c
@@ -23,39 +23,6 @@
 
 #include "openbsd-compat/bsd-signal.h"
 
-#undef signal
-
-mysig_t
-mysignal(int sig, mysig_t act)
-{
-#ifdef HAVE_SIGACTION
-	struct sigaction sa, osa;
-
-	if (sigaction(sig, NULL, &osa) == -1)
-		return (mysig_t) -1;
-	if (osa.sa_handler != act) {
-		memset(&sa, 0, sizeof(sa));
-		sigemptyset(&sa.sa_mask);
-		sa.sa_flags = 0;
-		if (sig == SIGALRM) {
-#ifdef SA_INTERRUPT
-			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;
-	}
-	return (osa.sa_handler);
-#else
-	return (signal(sig, act));
-#endif
-}
-
 #if !defined(HAVE_STRSIGNAL)
 char *strsignal(int sig)
 {
diff --git a/openbsd-compat/bsd-signal.h b/openbsd-compat/bsd-signal.h
index 4cb8cb7a..dafb4b19 100644
--- a/openbsd-compat/bsd-signal.h
+++ b/openbsd-compat/bsd-signal.h
@@ -27,11 +27,6 @@
 # endif
 #endif
 
-/* wrapper for signal interface */
-typedef void (*mysig_t)(int);
-mysig_t mysignal(int sig, mysig_t act);
-#define signal(a,b) mysignal(a,b)
-
 #if !defined(HAVE_STRSIGNAL)
 char *strsignal(int);
 #endif

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


More information about the openssh-commits mailing list