diff options
author | Colin Watson <cjwatson@debian.org> | 2020-04-17 20:57:17 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-04-17 20:57:17 +0100 |
commit | 75073d0a8478441cc97a6efa10b566c5fb1dac81 (patch) | |
tree | b73bff259e1b16829ed8b19ee92df2bbbf36ef7d /openbsd-compat | |
parent | c923f422b1e455bdd8ec3bdb10d005e3bfbacfe0 (diff) |
New upstream version 1.4.0
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 4 | ||||
-rw-r--r-- | openbsd-compat/readpassphrase.c | 6 | ||||
-rw-r--r-- | openbsd-compat/readpassphrase.h | 2 |
3 files changed, 9 insertions, 3 deletions
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 @@ | |||
32 | #define be32toh(x) ntohl((x)) | 32 | #define be32toh(x) ntohl((x)) |
33 | #endif /* _WIN32 && !HAVE_ENDIAN_H */ | 33 | #endif /* _WIN32 && !HAVE_ENDIAN_H */ |
34 | 34 | ||
35 | #if defined(__FreeBSD__) && !defined(HAVE_ENDIAN_H) | ||
36 | #include <sys/endian.h> | ||
37 | #endif | ||
38 | |||
35 | #include <stdlib.h> | 39 | #include <stdlib.h> |
36 | 40 | ||
37 | #if !defined(HAVE_STRLCAT) | 41 | #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 @@ | |||
52 | # define _POSIX_VDISABLE VDISABLE | 52 | # define _POSIX_VDISABLE VDISABLE |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | static volatile sig_atomic_t signo[_NSIG]; | 55 | static volatile sig_atomic_t signo[NSIG]; |
56 | 56 | ||
57 | static void handler(int); | 57 | static void handler(int); |
58 | 58 | ||
@@ -73,7 +73,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | restart: | 75 | restart: |
76 | for (i = 0; i < _NSIG; i++) | 76 | for (i = 0; i < NSIG; i++) |
77 | signo[i] = 0; | 77 | signo[i] = 0; |
78 | need_restart = 0; | 78 | need_restart = 0; |
79 | /* | 79 | /* |
@@ -177,7 +177,7 @@ restart: | |||
177 | * If we were interrupted by a signal, resend it to ourselves | 177 | * If we were interrupted by a signal, resend it to ourselves |
178 | * now that we have restored the signal handlers. | 178 | * now that we have restored the signal handlers. |
179 | */ | 179 | */ |
180 | for (i = 0; i < _NSIG; i++) { | 180 | for (i = 0; i < NSIG; i++) { |
181 | if (signo[i]) { | 181 | if (signo[i]) { |
182 | kill(getpid(), i); | 182 | kill(getpid(), i); |
183 | switch (i) { | 183 | 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 @@ | |||
27 | 27 | ||
28 | #ifndef HAVE_READPASSPHRASE | 28 | #ifndef HAVE_READPASSPHRASE |
29 | 29 | ||
30 | #include <stdlib.h> | ||
31 | |||
30 | #define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */ | 32 | #define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */ |
31 | #define RPP_ECHO_ON 0x01 /* Leave echo on. */ | 33 | #define RPP_ECHO_ON 0x01 /* Leave echo on. */ |
32 | #define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */ | 34 | #define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */ |