Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/1967?usp=email )
Change subject: Assume termios.h is available on all non Windows platforms ...................................................................... Assume termios.h is available on all non Windows platforms Checking for something that is available on all (non Windows) platforms is not very useful. So just always use termios.h Change-Id: I09b055f15e35614eab112ff69166c6985f8770da Signed-off-by: Arne Schwabe <[email protected]> Acked-by: Gert Doering <[email protected]> Acked-by: Frank Lichtenheld <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1967 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg39661.html Signed-off-by: Gert Doering <[email protected]> --- M configure.ac M src/openvpn/console_builtin.c 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 1fa0e63..195116f 100644 --- a/configure.ac +++ b/configure.ac @@ -459,7 +459,7 @@ sys/time.h sys/ioctl.h sys/stat.h \ sys/mman.h sys/file.h sys/wait.h \ libgen.h stropts.h \ - syslog.h pwd.h grp.h termios.h \ + syslog.h pwd.h grp.h \ sys/sockio.h sys/uio.h \ poll.h sys/epoll.h err.h \ ]) diff --git a/src/openvpn/console_builtin.c b/src/openvpn/console_builtin.c index cf6cc37..4737677 100644 --- a/src/openvpn/console_builtin.c +++ b/src/openvpn/console_builtin.c @@ -37,7 +37,7 @@ #include "buffer.h" #include "misc.h" -#ifdef HAVE_TERMIOS_H +#ifndef _WIN32 #include <termios.h> #endif @@ -133,10 +133,7 @@ return false; } -#endif /* _WIN32 */ - - -#ifdef HAVE_TERMIOS_H +#else /** * Open the current console TTY for read/write operations @@ -175,7 +172,7 @@ } } -#endif /* HAVE_TERMIOS_H */ +#endif /** @@ -196,10 +193,8 @@ ASSERT(capacity > 0); input[0] = '\0'; -#if defined(_WIN32) +#ifdef _WIN32 return get_console_input_win32(prompt, echo, input, capacity); -#elif !defined(HAVE_TERMIOS_H) - msg(M_FATAL, "Sorry, but I can't get console input on this OS (%s)", prompt); #else bool restore_tty = false; bool ret = false; @@ -260,7 +255,7 @@ close_tty(fp); return ret; -#endif /* if defined(_WIN32) */ +#endif } /** -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/1967?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I09b055f15e35614eab112ff69166c6985f8770da Gerrit-Change-Number: 1967 Gerrit-PatchSet: 3 Gerrit-Owner: plaisthos <[email protected]> Gerrit-Reviewer: Frank Lichtenheld <[email protected]> Gerrit-Reviewer: Gert Doering <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
