diff options
| author | jsing <> | 2014-04-24 14:03:38 +0000 |
|---|---|---|
| committer | jsing <> | 2014-04-24 14:03:38 +0000 |
| commit | fd45b1e98ea82c5c2fe1d204efe7c747f6dfb0ac (patch) | |
| tree | 3ad782f0335f6118eb5bd4143c8c1e671768a3ea /src | |
| parent | 632dfc0b25e514c7dc404fa5073c6e60aac6f67e (diff) | |
| download | openbsd-fd45b1e98ea82c5c2fe1d204efe7c747f6dfb0ac.tar.gz openbsd-fd45b1e98ea82c5c2fe1d204efe7c747f6dfb0ac.tar.bz2 openbsd-fd45b1e98ea82c5c2fe1d204efe7c747f6dfb0ac.zip | |
You want signals?!? I'll give you signals!!! Oh, and we have termios as
well...
ok beck@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_openssl.c | 36 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/ui/ui_openssl.c | 36 |
2 files changed, 0 insertions, 72 deletions
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c index 7ae1601e53..a67cf53f2a 100644 --- a/src/lib/libcrypto/ui/ui_openssl.c +++ b/src/lib/libcrypto/ui/ui_openssl.c | |||
| @@ -141,27 +141,13 @@ | |||
| 141 | * TERMIO, TERMIOS, VMS, MSDOS and SGTTY | 141 | * TERMIO, TERMIOS, VMS, MSDOS and SGTTY |
| 142 | */ | 142 | */ |
| 143 | 143 | ||
| 144 | #ifdef _LIBC | ||
| 145 | #undef TERMIOS | ||
| 146 | #define TERMIO | ||
| 147 | #undef SGTTY | ||
| 148 | #endif | ||
| 149 | 144 | ||
| 150 | #ifdef TERMIOS | ||
| 151 | #include <termios.h> | 145 | #include <termios.h> |
| 152 | #define TTY_STRUCT struct termios | 146 | #define TTY_STRUCT struct termios |
| 153 | #define TTY_FLAGS c_lflag | 147 | #define TTY_FLAGS c_lflag |
| 154 | #define TTY_get(tty,data) tcgetattr(tty,data) | 148 | #define TTY_get(tty,data) tcgetattr(tty,data) |
| 155 | #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) | 149 | #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) |
| 156 | #endif | ||
| 157 | 150 | ||
| 158 | #ifdef TERMIO | ||
| 159 | #include <termio.h> | ||
| 160 | #define TTY_STRUCT struct termio | ||
| 161 | #define TTY_FLAGS c_lflag | ||
| 162 | #define TTY_get(tty,data) ioctl(tty,TCGETA,data) | ||
| 163 | #define TTY_set(tty,data) ioctl(tty,TCSETA,data) | ||
| 164 | #endif | ||
| 165 | 151 | ||
| 166 | #include <sys/ioctl.h> | 152 | #include <sys/ioctl.h> |
| 167 | 153 | ||
| @@ -171,11 +157,7 @@ | |||
| 171 | 157 | ||
| 172 | 158 | ||
| 173 | /* Define globals. They are protected by a lock */ | 159 | /* Define globals. They are protected by a lock */ |
| 174 | #ifdef SIGACTION | ||
| 175 | static struct sigaction savsig[NX509_SIG]; | 160 | static struct sigaction savsig[NX509_SIG]; |
| 176 | #else | ||
| 177 | static void (*savsig[NX509_SIG]) (int); | ||
| 178 | #endif | ||
| 179 | 161 | ||
| 180 | static TTY_STRUCT tty_orig, tty_new; | 162 | static TTY_STRUCT tty_orig, tty_new; |
| 181 | static FILE *tty_in, *tty_out; | 163 | static FILE *tty_in, *tty_out; |
| @@ -416,36 +398,22 @@ static void | |||
| 416 | pushsig(void) | 398 | pushsig(void) |
| 417 | { | 399 | { |
| 418 | int i; | 400 | int i; |
| 419 | #ifdef SIGACTION | ||
| 420 | struct sigaction sa; | 401 | struct sigaction sa; |
| 421 | 402 | ||
| 422 | memset(&sa, 0, sizeof sa); | 403 | memset(&sa, 0, sizeof sa); |
| 423 | sa.sa_handler = recsig; | 404 | sa.sa_handler = recsig; |
| 424 | #endif | ||
| 425 | 405 | ||
| 426 | for (i = 1; i < NX509_SIG; i++) { | 406 | for (i = 1; i < NX509_SIG; i++) { |
| 427 | #ifdef SIGUSR1 | ||
| 428 | if (i == SIGUSR1) | 407 | if (i == SIGUSR1) |
| 429 | continue; | 408 | continue; |
| 430 | #endif | ||
| 431 | #ifdef SIGUSR2 | ||
| 432 | if (i == SIGUSR2) | 409 | if (i == SIGUSR2) |
| 433 | continue; | 410 | continue; |
| 434 | #endif | ||
| 435 | #ifdef SIGKILL | ||
| 436 | if (i == SIGKILL) /* We can't make any action on that. */ | 411 | if (i == SIGKILL) /* We can't make any action on that. */ |
| 437 | continue; | 412 | continue; |
| 438 | #endif | ||
| 439 | #ifdef SIGACTION | ||
| 440 | sigaction(i, &sa, &savsig[i]); | 413 | sigaction(i, &sa, &savsig[i]); |
| 441 | #else | ||
| 442 | savsig[i] = signal(i, recsig); | ||
| 443 | #endif | ||
| 444 | } | 414 | } |
| 445 | 415 | ||
| 446 | #ifdef SIGWINCH | ||
| 447 | signal(SIGWINCH, SIG_DFL); | 416 | signal(SIGWINCH, SIG_DFL); |
| 448 | #endif | ||
| 449 | } | 417 | } |
| 450 | 418 | ||
| 451 | static void | 419 | static void |
| @@ -457,11 +425,7 @@ popsig(void) | |||
| 457 | continue; | 425 | continue; |
| 458 | if (i == SIGUSR2) | 426 | if (i == SIGUSR2) |
| 459 | continue; | 427 | continue; |
| 460 | #ifdef SIGACTION | ||
| 461 | sigaction(i, &savsig[i], NULL); | 428 | sigaction(i, &savsig[i], NULL); |
| 462 | #else | ||
| 463 | signal(i, savsig[i]); | ||
| 464 | #endif | ||
| 465 | } | 429 | } |
| 466 | } | 430 | } |
| 467 | 431 | ||
diff --git a/src/lib/libssl/src/crypto/ui/ui_openssl.c b/src/lib/libssl/src/crypto/ui/ui_openssl.c index 7ae1601e53..a67cf53f2a 100644 --- a/src/lib/libssl/src/crypto/ui/ui_openssl.c +++ b/src/lib/libssl/src/crypto/ui/ui_openssl.c | |||
| @@ -141,27 +141,13 @@ | |||
| 141 | * TERMIO, TERMIOS, VMS, MSDOS and SGTTY | 141 | * TERMIO, TERMIOS, VMS, MSDOS and SGTTY |
| 142 | */ | 142 | */ |
| 143 | 143 | ||
| 144 | #ifdef _LIBC | ||
| 145 | #undef TERMIOS | ||
| 146 | #define TERMIO | ||
| 147 | #undef SGTTY | ||
| 148 | #endif | ||
| 149 | 144 | ||
| 150 | #ifdef TERMIOS | ||
| 151 | #include <termios.h> | 145 | #include <termios.h> |
| 152 | #define TTY_STRUCT struct termios | 146 | #define TTY_STRUCT struct termios |
| 153 | #define TTY_FLAGS c_lflag | 147 | #define TTY_FLAGS c_lflag |
| 154 | #define TTY_get(tty,data) tcgetattr(tty,data) | 148 | #define TTY_get(tty,data) tcgetattr(tty,data) |
| 155 | #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) | 149 | #define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data) |
| 156 | #endif | ||
| 157 | 150 | ||
| 158 | #ifdef TERMIO | ||
| 159 | #include <termio.h> | ||
| 160 | #define TTY_STRUCT struct termio | ||
| 161 | #define TTY_FLAGS c_lflag | ||
| 162 | #define TTY_get(tty,data) ioctl(tty,TCGETA,data) | ||
| 163 | #define TTY_set(tty,data) ioctl(tty,TCSETA,data) | ||
| 164 | #endif | ||
| 165 | 151 | ||
| 166 | #include <sys/ioctl.h> | 152 | #include <sys/ioctl.h> |
| 167 | 153 | ||
| @@ -171,11 +157,7 @@ | |||
| 171 | 157 | ||
| 172 | 158 | ||
| 173 | /* Define globals. They are protected by a lock */ | 159 | /* Define globals. They are protected by a lock */ |
| 174 | #ifdef SIGACTION | ||
| 175 | static struct sigaction savsig[NX509_SIG]; | 160 | static struct sigaction savsig[NX509_SIG]; |
| 176 | #else | ||
| 177 | static void (*savsig[NX509_SIG]) (int); | ||
| 178 | #endif | ||
| 179 | 161 | ||
| 180 | static TTY_STRUCT tty_orig, tty_new; | 162 | static TTY_STRUCT tty_orig, tty_new; |
| 181 | static FILE *tty_in, *tty_out; | 163 | static FILE *tty_in, *tty_out; |
| @@ -416,36 +398,22 @@ static void | |||
| 416 | pushsig(void) | 398 | pushsig(void) |
| 417 | { | 399 | { |
| 418 | int i; | 400 | int i; |
| 419 | #ifdef SIGACTION | ||
| 420 | struct sigaction sa; | 401 | struct sigaction sa; |
| 421 | 402 | ||
| 422 | memset(&sa, 0, sizeof sa); | 403 | memset(&sa, 0, sizeof sa); |
| 423 | sa.sa_handler = recsig; | 404 | sa.sa_handler = recsig; |
| 424 | #endif | ||
| 425 | 405 | ||
| 426 | for (i = 1; i < NX509_SIG; i++) { | 406 | for (i = 1; i < NX509_SIG; i++) { |
| 427 | #ifdef SIGUSR1 | ||
| 428 | if (i == SIGUSR1) | 407 | if (i == SIGUSR1) |
| 429 | continue; | 408 | continue; |
| 430 | #endif | ||
| 431 | #ifdef SIGUSR2 | ||
| 432 | if (i == SIGUSR2) | 409 | if (i == SIGUSR2) |
| 433 | continue; | 410 | continue; |
| 434 | #endif | ||
| 435 | #ifdef SIGKILL | ||
| 436 | if (i == SIGKILL) /* We can't make any action on that. */ | 411 | if (i == SIGKILL) /* We can't make any action on that. */ |
| 437 | continue; | 412 | continue; |
| 438 | #endif | ||
| 439 | #ifdef SIGACTION | ||
| 440 | sigaction(i, &sa, &savsig[i]); | 413 | sigaction(i, &sa, &savsig[i]); |
| 441 | #else | ||
| 442 | savsig[i] = signal(i, recsig); | ||
| 443 | #endif | ||
| 444 | } | 414 | } |
| 445 | 415 | ||
| 446 | #ifdef SIGWINCH | ||
| 447 | signal(SIGWINCH, SIG_DFL); | 416 | signal(SIGWINCH, SIG_DFL); |
| 448 | #endif | ||
| 449 | } | 417 | } |
| 450 | 418 | ||
| 451 | static void | 419 | static void |
| @@ -457,11 +425,7 @@ popsig(void) | |||
| 457 | continue; | 425 | continue; |
| 458 | if (i == SIGUSR2) | 426 | if (i == SIGUSR2) |
| 459 | continue; | 427 | continue; |
| 460 | #ifdef SIGACTION | ||
| 461 | sigaction(i, &savsig[i], NULL); | 428 | sigaction(i, &savsig[i], NULL); |
| 462 | #else | ||
| 463 | signal(i, savsig[i]); | ||
| 464 | #endif | ||
| 465 | } | 429 | } |
| 466 | } | 430 | } |
| 467 | 431 | ||
