1 Star 0 Fork 98

Mingtai/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-login-use-bus_error_message-at-one-more-place.patch 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
From 98f8c18db0edda121db05171fbaf35c342fd86b2 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sun, 30 Jan 2022 05:38:35 +0900
Subject: [PATCH] login: use bus_error_message() at one more place
(cherry picked from commit 80c8c786a314bceba180fac5506e72aa48c0764a)
(cherry picked from commit 048487c094a149e99b4067c8cd2d3974a8f17397)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/98f8c18db0edda121db05171fbaf35c342fd86b2
---
src/login/logind-user.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index a2c468e8dd..3c65867cb6 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -358,15 +358,19 @@ static void user_start_service(User *u) {
static int update_slice_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
_cleanup_(user_record_unrefp) UserRecord *ur = userdata;
+ const sd_bus_error *e;
+ int r;
assert(m);
assert(ur);
- if (sd_bus_message_is_method_error(m, NULL)) {
- log_warning_errno(sd_bus_message_get_errno(m),
+ e = sd_bus_message_get_error(m);
+ if (e) {
+ r = sd_bus_error_get_errno(e);
+ log_warning_errno(r,
"Failed to update slice of %s, ignoring: %s",
ur->user_name,
- sd_bus_message_get_error(m)->message);
+ bus_error_message(e, r));
return 0;
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd.git
git@gitee.com:yangmingtaip/systemd.git
yangmingtaip
systemd
systemd
master

搜索帮助