]> granicus.if.org Git - sudo/commitdiff
Require POSIX termios to build sudo
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jun 2010 15:09:55 +0000 (11:09 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jun 2010 15:09:55 +0000 (11:09 -0400)
common/lbuf.c
common/term.c
config.h.in
configure
configure.in
src/exec.c
src/exec_pty.c
src/ttysize.c

index 0b2d26fb48568913e67be98a98916f1247f8f3da..b1d3343ef8a00330d0d100b1b10af6de63ef2715 100644 (file)
 # include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #include <ctype.h>
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# include <termio.h>
-#endif
+#include <termios.h>
 
 #include <compat.h>
 #include <alloc.h>
index be59ba708aef0c9ebe8dbaf44d1f4fa9ff0280c1..7f0a3c220d579663500cda46bf67d6c64f112fac 100644 (file)
 #  include <strings.h>
 # endif
 #endif /* HAVE_STRING_H */
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# include <termio.h>
-#endif /* HAVE_TERMIOS_H */
+#include <termios.h>
 
 #include <compat.h>
 
 # endif
 #endif
 
-/*
- * Emulate POSIX termios using termio
- */
-#ifndef HAVE_TERMIOS_H
-# undef termios
-# define termios               termio
-# define tcgetattr(f, t)       ioctl(f, TCGETA, t)
-# define tcsetattr(f, a, t)    ioctl(f, a, t)
-# undef TCSAFLUSH
-# define TCSAFLUSH             TCSETAF
-# undef TCSADRAIN
-# define TCSADRAIN             TCSETAW
-#endif /* HAVE_TERMIOS_H */
-
 static struct termios term, oterm;
 static int changed;
 int term_erase;
@@ -167,7 +149,6 @@ term_copy(int src, int dst)
 
     if (tcgetattr(src, &tt) != 0)
        return(0);
-    /* XXX - add TCSANOW compat define */
     if (tcsetattr(dst, TCSANOW|TCSASOFT, &tt) != 0)
        return(0);
     return(1);
index d03d9fde878e06a4441aaa53ad94d97ad9adb8ee..4db1e03cb3e93c42115a601bfb6df17933fb2163 100644 (file)
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-/* Define to 1 if you have the <termios.h> header file and the `tcgetattr'
-   function. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
 /* Define to 1 if you have struct timespec in sys/time.h */
 #undef HAVE_TIMESPEC
 
index 65f69c29c2f2c1944f24da057463067237354f23..5b3412f32355262d5fd79c733170474666ea2dbf 100755 (executable)
--- a/configure
+++ b/configure
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5
 $as_echo "$ac_cv_sys_posix_termios" >&6; }
 
-if test "$ac_cv_sys_posix_termios" = "yes"; then
-    $as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h
-
-else
-    for ac_header in termio.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "termio.h" "ac_cv_header_termio_h" "$ac_includes_default"
-if test "x$ac_cv_header_termio_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TERMIO_H 1
-_ACEOF
-
-else
-  as_fn_error "Must have either termios.h or termio.h to build sudo" "$LINENO" 5
-fi
-
-done
-
+if test "$ac_cv_sys_posix_termios" != "yes"; then
+    as_fn_error "Must have POSIX termios to build sudo" "$LINENO" 5
 fi
 if test ${with_logincap-'no'} != "no"; then
     for ac_header in login_cap.h
index 057387dfec45b71057f7d9beb8fee0fa467a3916..efd31eff5d7e1704c7c65e59bf4288446dcb1d89 100644 (file)
@@ -1858,10 +1858,8 @@ AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h)
 AC_SYS_POSIX_TERMIOS
-if test "$ac_cv_sys_posix_termios" = "yes"; then
-    AC_DEFINE(HAVE_TERMIOS_H)
-else
-    AC_CHECK_HEADERS(termio.h, [], [AC_MSG_ERROR([Must have either termios.h or termio.h to build sudo])])
+if test "$ac_cv_sys_posix_termios" != "yes"; then
+    AC_MSG_ERROR([Must have POSIX termios to build sudo])
 fi
 if test ${with_logincap-'no'} != "no"; then
     AC_CHECK_HEADERS(login_cap.h, [LOGINCAP_USAGE='[[-c class|-]] '; LCMAN=1
index 2e8cc932d16c01e33b28e6992a8ed9a79980118a..c46db05bbd5c94c731f5cd015bd2b7c04c12ac8c 100644 (file)
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/wait.h>
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# include <termio.h>
-#endif /* HAVE_TERMIOS_H */
 #include <sys/ioctl.h>
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
@@ -59,6 +54,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <termios.h>
 
 /* XXX - move to compat */
 #if !defined(NSIG)
index 9728b8112ec24939d19466260d4fab74b037fc19..87082e360ad2acb0ff96d0c5c994b9031dba5a5f 100644 (file)
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/wait.h>
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# include <termio.h>
-#endif /* HAVE_TERMIOS_H */
 #include <sys/ioctl.h>
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
@@ -58,6 +53,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <termios.h>
 
 /* XXX - move to compat.h */
 #if !defined(NSIG)
index 5517faa878f0003cb79a8b7a06a6bbdaf7212632..9e1afbf0f37566b1931d3af8de780595b622b89c 100644 (file)
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif /* HAVE_UNISTD_H */
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# include <termio.h>
-#endif
+#include <termios.h>
 
 #include <compat.h>