diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2009-12-21 18:10:42 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2009-12-21 18:10:42 +0000 |
commit | 80181818286828ec277264939007a9562f58a735 (patch) | |
tree | 0a2a979e270aa8c59a1c47397ab47e279009015d | |
parent | 8043deb1cfd389d9a8f4c3127e0a54ef3bd81915 (diff) | |
download | apr-80181818286828ec277264939007a9562f58a735.tar.gz |
Restore getpassword == getpass_r hack for older Novell NDKs.
partial revert of r892141
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892909 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/arch/netware/apr_private.h | 8 | ||||
-rw-r--r-- | passwd/apr_getpass.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 6e614339d..403af4417 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -56,6 +56,14 @@ #define HAVE_WRITEV 1 #define HAVE_GETPASS_R 1 +/* + * Hack around older NDKs which have only the getpassword() function, + * a threadsafe, API-equivilant of getpass_r(). + */ +#include <ndkvers.h> +#if (CURRENT_NDK_THRESHOLD < 709060000) +#define getpass_r getpassword +#endif /* 64-bit integer conversion function */ #define APR_INT64_STRFN strtoll diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 20e8738f7..48aef1c0c 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -34,9 +34,13 @@ #include <unistd.h> #endif #if APR_HAVE_CONIO_H +#ifdef _MSC_VER #pragma warning(disable: 4032) #include <conio.h> #pragma warning(default: 4032) +#else +#include <conio.h> +#endif #endif #if APR_HAVE_STDLIB_H #include <stdlib.h> @@ -75,9 +79,9 @@ #if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE) && !defined(HAVE_GETPASS_R) -/* MPE, Win32, NetWare and BeOS all lack a native getpass() */ +/* MPE, Win32, and BeOS all lack a native getpass() */ -#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) && !defined(NETWARE) +#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) /* * MPE lacks getpass() and a way to suppress stdin echo. So for now, just * issue the prompt and read the results with echo. (Ugh). |