1 Star 0 Fork 44

Interstellar6/less

forked from src-openEuler/less 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
From bd05d5102880eca0ea2a1f1f713dd2e568bc164c Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Mon, 29 May 2023 10:20:38 -0700
Subject: [PATCH] Move any_data under #if USE_POLL and ensure that tty variable
is not accessed when it does not exist (in MSDOS build).
---
os.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/os.c b/os.c
index 0edc859f..b9097c41 100644
--- a/os.c
+++ b/os.c
@@ -48,6 +48,7 @@ static int use_poll = TRUE;
#endif
#if USE_POLL
#include <poll.h>
+static int any_data = FALSE;
#endif
/*
@@ -72,7 +73,6 @@ public int consecutive_nulls = 0;
/* Milliseconds to wait for data before displaying "waiting for data" message. */
static int waiting_for_data_delay = 4000;
static jmp_buf read_label;
-static int any_data = FALSE;
extern int sigs;
extern int ignore_eoi;
@@ -292,8 +292,10 @@ public int iread(int fd, unsigned char *buf, unsigned int len)
#endif
return (READ_ERR);
}
+#if USE_POLL
if (fd != tty && n > 0)
any_data = TRUE;
+#endif
return (n);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/interstellar6/less.git
git@gitee.com:interstellar6/less.git
interstellar6
less
less
master

搜索帮助