Failure to connect to a Unix-domain socket could cause a segfault. Fixed.
[u/mdw/putty] / unix / configure.ac
index 9156356..5b0c0c9 100644 (file)
@@ -14,12 +14,16 @@ if test "X$GCC" = Xyes; then
     CFLAGS="$CFLAGS -Wall -Werror"
 fi
 
+AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
+#include <sys/types.h>
+#include <utmp.h>])
+
 AM_PATH_GTK([1.2.0], [all_targets="all-cli all-gtk"], [all_targets="all-cli"])
 AC_SUBST([all_targets])
 
 AC_SEARCH_LIBS([socket], [xnet])
 
-AC_CHECK_FUNCS([getaddrinfo ptsname pututline setresuid strsignal])
+AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
 
 AC_OUTPUT
 
@@ -35,10 +39,13 @@ AH_BOTTOM([
 #ifndef HAVE_STRSIGNAL
 # define HAVE_NO_STRSIGNAL
 #endif
-#ifndef HAVE_PUTUTLINE
+#if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX)
 # define OMIT_UTMP
 #endif
 #ifndef HAVE_PTSNAME
 # define BSD_PTYS
 #endif
+#ifndef HAVE_SYS_SELECT_H
+# define HAVE_NO_SYS_SELECT_H
+#endif
 ])