1 Star 0 Fork 44

shdluan/less

forked from src-openEuler/less 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
less-475-fsync.patch 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
fly_fzc 提交于 2021-09-24 11:40 . update version to 590
diff -ur less-418.orig/configure.ac less-418/configure.ac
--- less-418.orig/configure.ac 2008-12-22 07:10:44.000000000 -0500
+++ less-418/configure.ac 2008-12-22 07:28:58.000000000 -0500
@@ -203,6 +203,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],
@@ -251,7 +253,7 @@
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep])
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)
@@ -298,6 +300,16 @@
#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_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shdluan/less.git
git@gitee.com:shdluan/less.git
shdluan
less
less
master

搜索帮助