1 Star 0 Fork 101

YukariChiba/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-systemctl-small-fixes-for-MountImages-pretty-printin.patch 3.32 KB
一键复制 编辑 原始数据 按行查看 历史
From 1f332abc9f82c653d40e5f3e42b761dca88d31ed Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@microsoft.com>
Date: Wed, 27 Oct 2021 11:17:02 +0100
Subject: [PATCH] systemctl: small fixes for MountImages pretty printing
(cherry picked from commit 8ec6108c0bdb5ab2e05bc20ab41ad6653805fd00)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/1f332abc9f82c653d40e5f3e42b761dca88d31ed
---
src/systemctl/systemctl-show.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c
index 3bc9fd4920..290a501c52 100644
--- a/src/systemctl/systemctl-show.c
+++ b/src/systemctl/systemctl-show.c
@@ -1649,11 +1649,13 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
r = sd_bus_message_enter_container(m, 'r', "ssba(ss)");
if (r < 0)
- return r;
+ return bus_log_parse_error(r);
+ if (r == 0)
+ break;
r = sd_bus_message_read(m, "ssb", &source, &destination, &ignore_enoent);
- if (r <= 0)
- break;
+ if (r < 0)
+ return bus_log_parse_error(r);
str = strjoin(ignore_enoent ? "-" : "",
source,
@@ -1664,27 +1666,25 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
r = sd_bus_message_enter_container(m, 'a', "(ss)");
if (r < 0)
- return r;
+ return bus_log_parse_error(r);
while ((r = sd_bus_message_read(m, "(ss)", &partition, &mount_options)) > 0)
- if (!strextend_with_separator(&str, ":", partition, ":", mount_options))
+ if (!strextend_with_separator(&str, ":", partition, mount_options))
return log_oom();
if (r < 0)
- return r;
+ return bus_log_parse_error(r);
if (!strextend_with_separator(&paths, " ", str))
return log_oom();
r = sd_bus_message_exit_container(m);
if (r < 0)
- return r;
+ return bus_log_parse_error(r);
r = sd_bus_message_exit_container(m);
if (r < 0)
- return r;
+ return bus_log_parse_error(r);
}
- if (r < 0)
- return bus_log_parse_error(r);
r = sd_bus_message_exit_container(m);
if (r < 0)
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/YukariChiba/systemd.git
git@gitee.com:YukariChiba/systemd.git
YukariChiba
systemd
systemd
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385