# 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>
# 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;
if (tcgetattr(src, &tt) != 0)
return(0);
- /* XXX - add TCSANOW compat define */
if (tcsetattr(dst, TCSANOW|TCSASOFT, &tt) != 0)
return(0);
return(1);
/* 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
{ $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
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
#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>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <termios.h>
/* XXX - move to compat */
#if !defined(NSIG)
#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>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <termios.h>
/* XXX - move to compat.h */
#if !defined(NSIG)
#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>