Assume <termios.h> exists

It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-02 21:52:19 +01:00 committed by Serge Hallyn
parent b47aa1e9aa
commit 5777e583cd
2 changed files with 6 additions and 15 deletions

View File

@ -37,7 +37,7 @@ dnl Checks for libraries.
dnl Checks for header files. dnl Checks for header files.
AC_CHECK_HEADERS(crypt.h utmp.h \ AC_CHECK_HEADERS(crypt.h utmp.h \
termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \ termio.h sgtty.h sys/ioctl.h syslog.h paths.h \
utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \ utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \
gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \ gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \
attr/libattr.h attr/error_context.h) attr/libattr.h attr/error_context.h)

View File

@ -179,20 +179,11 @@ static inline void memzero(void *ptr, size_t size)
# define SEEK_END 2 # define SEEK_END 2
#endif #endif
#if HAVE_TERMIOS_H #include <termios.h>
# include <termios.h> #define STTY(fd, termio) tcsetattr(fd, TCSANOW, termio)
# define STTY(fd, termio) tcsetattr(fd, TCSANOW, termio) #define GTTY(fd, termio) tcgetattr(fd, termio)
# define GTTY(fd, termio) tcgetattr(fd, termio) #define TERMIO struct termios
# define TERMIO struct termios #define USE_TERMIOS
# define USE_TERMIOS
#else /* assumed HAVE_TERMIO_H */
# include <sys/ioctl.h>
# include <termio.h>
# define STTY(fd, termio) ioctl(fd, TCSETA, termio)
# define GTTY(fd, termio) ioctl(fd, TCGETA, termio)
# define TEMRIO struct termio
# define USE_TERMIO
#endif
/* /*
* Password aging constants * Password aging constants