72323b
diff -ur less-418.orig/configure.ac less-418/configure.ac
72323b
--- less-418.orig/configure.ac	2008-12-22 07:10:44.000000000 -0500
72323b
+++ less-418/configure.ac	2008-12-22 07:28:58.000000000 -0500
72323b
@@ -203,6 +203,8 @@
72323b
 	[Define HAVE_TIME_T if your system supports the "time_t" type.])
72323b
 AH_TEMPLATE([HAVE_STRERROR],
72323b
 	[Define HAVE_STRERROR if you have the strerror() function.])
72323b
+AH_TEMPLATE([HAVE_FSYNC],
72323b
+	[Define HAVE_FSYNC if fsync() on a tty works.])
72323b
 AH_TEMPLATE([HAVE_FILENO],
72323b
 	[Define HAVE_FILENO if you have the fileno() macro.])
72323b
 AH_TEMPLATE([HAVE_ERRNO],
72323b
@@ -251,7 +253,7 @@
72323b
 
72323b
 # Checks for library functions.
72323b
 AC_TYPE_SIGNAL
72323b
-AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
72323b
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
72323b
 
72323b
 # AC_CHECK_FUNCS may not work for inline functions, so test these separately.
72323b
 AC_MSG_CHECKING(for memcpy)
72323b
@@ -298,6 +300,16 @@
72323b
 #endif], [static char *x; x = strerror(0);],
72323b
   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
72323b
 
72323b
+AC_MSG_CHECKING(for fsync)
72323b
+AC_TRY_RUN([
72323b
+#include <fcntl.h>
72323b
+#include <unistd.h>
72323b
+int main(void)
72323b
+{
72323b
+        int fd = open("/dev/tty", O_RDWR);
72323b
+        return fsync(fd);
72323b
+}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)])
72323b
+
72323b
 AC_MSG_CHECKING(for sys_errlist)
72323b
 AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], 
72323b
   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])