1 Star 0 Fork 94

Mingtai/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-unit-file-avoid-null-in-debugging-logs.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
From e58e1472edc97ff2b234fda60fd0f977f12659fb Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sat, 23 Jul 2022 12:48:35 +0900
Subject: [PATCH] unit-file: avoid (null) in debugging logs
The variable `inst` was set to NULL by TAKE_PTR().
This fixes the following log message:
```
systemd[1]: Unit getty@tty2.service has alias (null).
```
(cherry picked from commit 7c35b78a0b96085e3d634542212c5521bc2a2f21)
(cherry picked from commit 9ac0ad80fe97c22ec3dc4670e859abaae9a1f8bf)
(cherry picked from commit 0e7214c8b5c95bc378ad6b9353e944ec0fba4e21)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/e58e1472edc97ff2b234fda60fd0f977f12659fb
---
src/basic/unit-file.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c
index d1e997ec9f..7b0c932654 100644
--- a/src/basic/unit-file.c
+++ b/src/basic/unit-file.c
@@ -520,12 +520,9 @@ static int add_names(
continue;
}
- r = set_consume(*names, TAKE_PTR(inst));
- if (r > 0)
- log_debug("Unit %s has alias %s.", unit_name, inst);
+ r = add_name(unit_name, names, inst);
} else
r = add_name(unit_name, names, *alias);
-
if (r < 0)
return r;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd.git
git@gitee.com:yangmingtaip/systemd.git
yangmingtaip
systemd
systemd
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385