mirror of
https://github.com/reactos/ccache.git
synced 2025-03-04 00:37:02 +00:00
Use tcgetattr() instead of ioctl() for portability
This commit is contained in:
parent
755eaafad9
commit
977253bc89
@ -172,7 +172,7 @@ AC_HEADER_TIME
|
||||
AC_HEADER_SYS_WAIT
|
||||
|
||||
AC_CHECK_HEADERS(ctype.h pwd.h stdlib.h string.h strings.h sys/time.h sys/mman.h)
|
||||
AC_CHECK_HEADERS(sys/ioctl.h termios.h)
|
||||
AC_CHECK_HEADERS(termios.h)
|
||||
|
||||
AC_CHECK_FUNCS(asprintf)
|
||||
AC_CHECK_FUNCS(gethostname)
|
||||
|
@ -19,10 +19,9 @@
|
||||
#include "ccache.h"
|
||||
#include "framework.h"
|
||||
#include <stdio.h>
|
||||
#if defined(HAVE_TERMIOS_H) && defined(HAVE_SYS_IOCTL_H)
|
||||
#if defined(HAVE_TERMIOS_H)
|
||||
#define USE_COLOR
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
static unsigned passed_asserts;
|
||||
@ -48,7 +47,7 @@ is_tty(int fd)
|
||||
{
|
||||
#ifdef USE_COLOR
|
||||
struct termios t;
|
||||
return ioctl(fd, TCGETS, &t) == 0;
|
||||
return tcgetattr(fd, &t) == 0;
|
||||
#else
|
||||
(void)fd;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user