summaryrefslogtreecommitdiff
path: root/less-475-fsync.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-07-14 04:12:04 +0000
committerCoprDistGit <infra@openeuler.org>2024-07-14 04:12:04 +0000
commitbf4050f2f1952c876915397a03adee45fa31ac77 (patch)
treef5b6dfe0a06753959c878be691446baa131124b7 /less-475-fsync.patch
parente66da3d58e62217d7864b58ea46aafc60a64ba00 (diff)
automatic import of lessopeneuler24.03_LTS
Diffstat (limited to 'less-475-fsync.patch')
-rw-r--r--less-475-fsync.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/less-475-fsync.patch b/less-475-fsync.patch
new file mode 100644
index 0000000..c964b31
--- /dev/null
+++ b/less-475-fsync.patch
@@ -0,0 +1,46 @@
+From 5396b6b77d0248678f716038dc747d6898acb0b3 Mon Sep 17 00:00:00 2001
+From: Stephen Gallagher <sgallagh@redhat.com>
+Date: Fri, 22 Jan 2021 09:49:13 -0500
+Subject: [PATCH] Test for fsync on tty
+
+Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
+
+Modified for less 581.2 Filip Januš <fjanus@redhat.com>
+diff -ur less-581.2/configure.ac less_fsync/configure.ac
+--- less-581.2/configure.ac 2021-04-28 17:00:08.000000000 +0200
++++ less_fsync/configure.ac 2021-05-06 10:59:07.560062397 +0200
+@@ -221,6 +221,8 @@
+ [Define HAVE_TIME_T if your system supports the "time_t" type.])
+ AH_TEMPLATE([HAVE_STRERROR],
+ [Define HAVE_STRERROR if you have the strerror() function.])
++AH_TEMPLATE([HAVE_FSYNC],
++ [Define HAVE_FSYNC if fsync() on a tty works.])
+ AH_TEMPLATE([HAVE_FILENO],
+ [Define HAVE_FILENO if you have the fileno() macro.])
+ AH_TEMPLATE([HAVE_ERRNO],
+@@ -274,7 +276,7 @@
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int f(int a) { return a; }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)],[AC_MSG_RESULT(no)])
+
+ # Checks for library functions.
+-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep])
++AC_CHECK_FUNCS([fchmod nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep])
+
+ # AC_CHECK_FUNCS may not work for inline functions, so test these separately.
+ AC_MSG_CHECKING(for memcpy)
+@@ -321,6 +323,16 @@
+ #include <errno.h>
+ #endif]], [[static char *x; x = strerror(0);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)],[AC_MSG_RESULT(no)])
+
++AC_MSG_CHECKING(for fsync)
++AC_TRY_RUN([
++#include <fcntl.h>
++#include <unistd.h>
++int main(void)
++{
++ int fd = open("/dev/tty", O_RDWR);
++ return fsync(fd);
++}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)])
++
+ AC_MSG_CHECKING(for sys_errlist)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *sys_errlist[]; static char **x; x = sys_errlist;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)],[AC_MSG_RESULT(no)])
+