1 Star 0 Fork 21

yangshx/lsof

forked from src-openEuler/lsof 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0060-endpoint-pseudoterminal-bug-fix-fix-wrong-Unix98-PTY.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 23:02 +08:00 . Package init
From abbcbb099008dfed895adbd54d60f10e4129c7aa Mon Sep 17 00:00:00 2001
From: Masatake YAMATO <yamato@redhat.com>
Date: Wed, 5 Dec 2018 00:12:06 +0900
Subject: [PATCH 60/83] endpoint(pseudoterminal),bug fix: fix wrong Unix98 PTY
slaves major number detection
A typo was in the code detecting Unix98 PTY slave device.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
dialects/linux/dnode.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dialects/linux/dnode.c b/dialects/linux/dnode.c
index 68b6a04..fa60557 100644
--- a/dialects/linux/dnode.c
+++ b/dialects/linux/dnode.c
@@ -354,8 +354,21 @@ int
is_pty_slave(sm)
int sm; /* slave major device number */
{
+ /* linux/Documentation/admin-guide/devices.txt
+ -------------------------------------------
+ 136-143 char Unix98 PTY slaves
+ 0 = /dev/pts/0 First Unix98 pseudo-TTY
+ 1 = /dev/pts/1 Second Unix98 pseudo-TTY
+ ...
+
+ These device nodes are automatically generated with
+ the proper permissions and modes by mounting the
+ devpts filesystem onto /dev/pts with the appropriate
+ mount options (distribution dependent, however, on
+ *most* distributions the appropriate options are
+ "mode=0620,gid=<gid of the "tty" group>".) */
if ((UNIX98_PTY_SLAVE_MAJOR <= sm)
- && (sm < (UNIX98_PTY_SLAVE_MAJOR + UNIX98_PTY_SLAVE_MAJOR))
+ && (sm < (UNIX98_PTY_SLAVE_MAJOR + UNIX98_PTY_MAJOR_COUNT))
) {
return 1;
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangshaoxing1001/lsof.git
git@gitee.com:yangshaoxing1001/lsof.git
yangshaoxing1001
lsof
lsof
master

搜索帮助