From 6791bdc9b6edcf67a5da718b50c0444ac512c935 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 13 May 2021 18:40:05 +0100 Subject: [PATCH] Don't #include if it doesn't exist. A FreeBSD user reports that it doesn't exist there. --- cmake/cmake.h.in | 1 + cmake/platforms/unix.cmake | 1 + unix/pty.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/cmake/cmake.h.in b/cmake/cmake.h.in index b6c07d2c..9de1386b 100644 --- a/cmake/cmake.h.in +++ b/cmake/cmake.h.in @@ -21,6 +21,7 @@ #cmakedefine01 HAVE_SYS_SYSCTL_H #cmakedefine01 HAVE_SYS_TYPES_H #cmakedefine01 HAVE_GLOB_H +#cmakedefine01 HAVE_UTMP_H #cmakedefine01 HAVE_FUTIMES #cmakedefine01 HAVE_GETADDRINFO #cmakedefine01 HAVE_POSIX_OPENPT diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake index 156919e7..cb47caf9 100644 --- a/cmake/platforms/unix.cmake +++ b/cmake/platforms/unix.cmake @@ -18,6 +18,7 @@ check_include_file(asm/hwcap.h HAVE_ASM_HWCAP_H) check_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(glob.h HAVE_GLOB_H) +check_include_file(utmp.h HAVE_UTMP_H) check_symbol_exists(futimes "sys/time.h" HAVE_FUTIMES) check_symbol_exists(getaddrinfo "sys/types.h;sys/socket.h;netdb.h" diff --git a/unix/pty.c b/unix/pty.c index 30e48e50..abafa108 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -13,7 +13,9 @@ #include #include #include +#if HAVE_UTMP_H #include +#endif #include #include #include