1 Star 0 Fork 48

Meredith/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0732-core-make-sure-we-don-t-get-confused-when-setting-TE.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:44 . update to systemd-239-58.el8.src.rpm
From 858519383fec2b3fadc1b8423214f703d69d6a6c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 22 Apr 2020 21:52:22 +0200
Subject: [PATCH] core: make sure we don't get confused when setting TERM for a
tty fd
Fixes: #15344
(cherry picked from commit e8cf09b2a2ad0d48e5493050d54251d5f512d9b6)
Resolves: #2045307
---
src/core/execute.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/core/execute.c b/src/core/execute.c
index d528d08830..a104294966 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1709,12 +1709,13 @@ static int build_environment(
tty_path = exec_context_tty_path(c);
- /* If we are forked off PID 1 and we are supposed to operate on /dev/console, then let's try to inherit
- * the $TERM set for PID 1. This is useful for containers so that the $TERM the container manager
- * passes to PID 1 ends up all the way in the console login shown. */
+ /* If we are forked off PID 1 and we are supposed to operate on /dev/console, then let's try
+ * to inherit the $TERM set for PID 1. This is useful for containers so that the $TERM the
+ * container manager passes to PID 1 ends up all the way in the console login shown. */
- if (path_equal(tty_path, "/dev/console") && getppid() == 1)
+ if (path_equal_ptr(tty_path, "/dev/console") && getppid() == 1)
term = getenv("TERM");
+
if (!term)
term = default_term_for_tty(tty_path);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yueeranna/systemd.git
git@gitee.com:yueeranna/systemd.git
yueeranna
systemd
systemd
a8

搜索帮助