1 Star 0 Fork 50

zhongling.h/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0931-utmp-wtmp-fix-error-in-case-isatty-fails.patch 938 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-12-26 10:07 . update to systemd-239-78.src.rpm
From c57daab191c6551ac757576fcf7df45fd9790b6b Mon Sep 17 00:00:00 2001
From: Lennart Poettering <[email protected]>
Date: Tue, 22 Nov 2022 12:56:38 +0100
Subject: [PATCH] utmp-wtmp: fix error in case isatty() fails
(cherry picked from commit 80b780ba178a84b248ecee47eef82358480c9492)
Related: #2172846
---
src/shared/utmp-wtmp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
index ef9427fa7b..743b784489 100644
--- a/src/shared/utmp-wtmp.c
+++ b/src/shared/utmp-wtmp.c
@@ -312,8 +312,10 @@ static int write_to_terminal(const char *tty, const char *message) {
assert(message);
fd = open(tty, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_CLOEXEC);
- if (fd < 0 || !isatty(fd))
+ if (fd < 0)
return -errno;
+ if (!isatty(fd))
+ return -ENOTTY;
p = message;
left = strlen(message);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhonglingh/systemd.git
[email protected]:zhonglingh/systemd.git
zhonglingh
systemd
systemd
a8

搜索帮助