Blame SOURCES/less-418-fsync.patch

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