Blame SOURCES/less-418-fsync.patch

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