From 73e3410aa5d2e07cb47e1721b767ca44dd1403e0 Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 24 Apr 2014 14:03:38 +0000 Subject: [PATCH] You want signals?!? I'll give you signals!!! Oh, and we have termios as well... ok beck@ --- lib/libcrypto/ui/ui_openssl.c | 36 --------------------------- lib/libssl/src/crypto/ui/ui_openssl.c | 36 --------------------------- 2 files changed, 72 deletions(-) diff --git a/lib/libcrypto/ui/ui_openssl.c b/lib/libcrypto/ui/ui_openssl.c index 7ae1601e532..a67cf53f2af 100644 --- a/lib/libcrypto/ui/ui_openssl.c +++ b/lib/libcrypto/ui/ui_openssl.c @@ -141,27 +141,13 @@ * TERMIO, TERMIOS, VMS, MSDOS and SGTTY */ -#ifdef _LIBC -#undef TERMIOS -#define TERMIO -#undef SGTTY -#endif -#ifdef TERMIOS #include #define TTY_STRUCT struct termios #define TTY_FLAGS c_lflag #define TTY_get(tty,data) tcgetattr(tty,data) #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) -#endif -#ifdef TERMIO -#include -#define TTY_STRUCT struct termio -#define TTY_FLAGS c_lflag -#define TTY_get(tty,data) ioctl(tty,TCGETA,data) -#define TTY_set(tty,data) ioctl(tty,TCSETA,data) -#endif #include @@ -171,11 +157,7 @@ /* Define globals. They are protected by a lock */ -#ifdef SIGACTION static struct sigaction savsig[NX509_SIG]; -#else -static void (*savsig[NX509_SIG]) (int); -#endif static TTY_STRUCT tty_orig, tty_new; static FILE *tty_in, *tty_out; @@ -416,36 +398,22 @@ static void pushsig(void) { int i; -#ifdef SIGACTION struct sigaction sa; memset(&sa, 0, sizeof sa); sa.sa_handler = recsig; -#endif for (i = 1; i < NX509_SIG; i++) { -#ifdef SIGUSR1 if (i == SIGUSR1) continue; -#endif -#ifdef SIGUSR2 if (i == SIGUSR2) continue; -#endif -#ifdef SIGKILL if (i == SIGKILL) /* We can't make any action on that. */ continue; -#endif -#ifdef SIGACTION sigaction(i, &sa, &savsig[i]); -#else - savsig[i] = signal(i, recsig); -#endif } -#ifdef SIGWINCH signal(SIGWINCH, SIG_DFL); -#endif } static void @@ -457,11 +425,7 @@ popsig(void) continue; if (i == SIGUSR2) continue; -#ifdef SIGACTION sigaction(i, &savsig[i], NULL); -#else - signal(i, savsig[i]); -#endif } } diff --git a/lib/libssl/src/crypto/ui/ui_openssl.c b/lib/libssl/src/crypto/ui/ui_openssl.c index 7ae1601e532..a67cf53f2af 100644 --- a/lib/libssl/src/crypto/ui/ui_openssl.c +++ b/lib/libssl/src/crypto/ui/ui_openssl.c @@ -141,27 +141,13 @@ * TERMIO, TERMIOS, VMS, MSDOS and SGTTY */ -#ifdef _LIBC -#undef TERMIOS -#define TERMIO -#undef SGTTY -#endif -#ifdef TERMIOS #include #define TTY_STRUCT struct termios #define TTY_FLAGS c_lflag #define TTY_get(tty,data) tcgetattr(tty,data) #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) -#endif -#ifdef TERMIO -#include -#define TTY_STRUCT struct termio -#define TTY_FLAGS c_lflag -#define TTY_get(tty,data) ioctl(tty,TCGETA,data) -#define TTY_set(tty,data) ioctl(tty,TCSETA,data) -#endif #include @@ -171,11 +157,7 @@ /* Define globals. They are protected by a lock */ -#ifdef SIGACTION static struct sigaction savsig[NX509_SIG]; -#else -static void (*savsig[NX509_SIG]) (int); -#endif static TTY_STRUCT tty_orig, tty_new; static FILE *tty_in, *tty_out; @@ -416,36 +398,22 @@ static void pushsig(void) { int i; -#ifdef SIGACTION struct sigaction sa; memset(&sa, 0, sizeof sa); sa.sa_handler = recsig; -#endif for (i = 1; i < NX509_SIG; i++) { -#ifdef SIGUSR1 if (i == SIGUSR1) continue; -#endif -#ifdef SIGUSR2 if (i == SIGUSR2) continue; -#endif -#ifdef SIGKILL if (i == SIGKILL) /* We can't make any action on that. */ continue; -#endif -#ifdef SIGACTION sigaction(i, &sa, &savsig[i]); -#else - savsig[i] = signal(i, recsig); -#endif } -#ifdef SIGWINCH signal(SIGWINCH, SIG_DFL); -#endif } static void @@ -457,11 +425,7 @@ popsig(void) continue; if (i == SIGUSR2) continue; -#ifdef SIGACTION sigaction(i, &savsig[i], NULL); -#else - signal(i, savsig[i]); -#endif } } -- 2.20.1