--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -190,7 +190,7 @@
 # undef  SGTTY
 #endif
 
-#if defined(linux) && !defined(TERMIO)
+#if defined(linux) && !defined(TERMIO) && !defined(TERMIOS)
 # undef  TERMIOS
 # define TERMIO
 # undef  SGTTY