From 75073d0a8478441cc97a6efa10b566c5fb1dac81 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Apr 2020 20:57:17 +0100 Subject: New upstream version 1.4.0 --- openbsd-compat/openbsd-compat.h | 4 ++++ openbsd-compat/readpassphrase.c | 6 +++--- openbsd-compat/readpassphrase.h | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'openbsd-compat') diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index bee126c..30d80b3 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -32,6 +32,10 @@ #define be32toh(x) ntohl((x)) #endif /* _WIN32 && !HAVE_ENDIAN_H */ +#if defined(__FreeBSD__) && !defined(HAVE_ENDIAN_H) +#include +#endif + #include #if !defined(HAVE_STRLCAT) diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index dfb3065..8b84190 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -52,7 +52,7 @@ # define _POSIX_VDISABLE VDISABLE #endif -static volatile sig_atomic_t signo[_NSIG]; +static volatile sig_atomic_t signo[NSIG]; static void handler(int); @@ -73,7 +73,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) } restart: - for (i = 0; i < _NSIG; i++) + for (i = 0; i < NSIG; i++) signo[i] = 0; need_restart = 0; /* @@ -177,7 +177,7 @@ restart: * If we were interrupted by a signal, resend it to ourselves * now that we have restored the signal handlers. */ - for (i = 0; i < _NSIG; i++) { + for (i = 0; i < NSIG; i++) { if (signo[i]) { kill(getpid(), i); switch (i) { diff --git a/openbsd-compat/readpassphrase.h b/openbsd-compat/readpassphrase.h index 0c4a59e..e4451f3 100644 --- a/openbsd-compat/readpassphrase.h +++ b/openbsd-compat/readpassphrase.h @@ -27,6 +27,8 @@ #ifndef HAVE_READPASSPHRASE +#include + #define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */ #define RPP_ECHO_ON 0x01 /* Leave echo on. */ #define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */ -- cgit v1.2.3