2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-06 01:05:43 +00:00

Require POSIX termios to build sudo

This commit is contained in:
Todd C. Miller
2010-06-09 11:09:55 -04:00
parent 82a56e421f
commit e5283b2f96
8 changed files with 9 additions and 69 deletions

View File

@@ -41,11 +41,7 @@
# 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>

View File

@@ -37,11 +37,7 @@
# 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>
@@ -66,20 +62,6 @@
# 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);

View File

@@ -534,13 +534,6 @@
/* 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

20
configure vendored
View File

@@ -13970,24 +13970,8 @@ fi
{ $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

View 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

View File

@@ -22,11 +22,6 @@
#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)

View File

@@ -21,11 +21,6 @@
#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)

View File

@@ -32,11 +32,7 @@
#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>