From: Arne Schwabe <[email protected]>

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
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1967
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]>
Frank Lichtenheld <[email protected]>

        
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 9c8d72a..10369283 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
 
@@ -134,10 +134,7 @@
     return false;
 }
 
-#endif /* _WIN32 */
-
-
-#ifdef HAVE_TERMIOS_H
+#else
 
 /**
  * Open the current console TTY for read/write operations
@@ -176,7 +173,7 @@
     }
 }
 
-#endif /* HAVE_TERMIOS_H */
+#endif
 
 
 /**
@@ -197,10 +194,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;
@@ -261,7 +256,7 @@
 
     close_tty(fp);
     return ret;
-#endif /* if defined(_WIN32) */
+#endif
 }
 
 /**


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to