1 Star 0 Fork 49

alpha_wang/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0456-dbus-execute-make-transfer-of-CPUAffinity-endian-saf.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:46 . update to systemd-239-45.el8.src.rpm
From 1730f7bb306e13689a7684fd93ae5b8383a28d2f Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekletar@users.noreply.github.com>
Date: Fri, 31 May 2019 15:23:23 +0200
Subject: [PATCH] dbus-execute: make transfer of CPUAffinity endian safe
(#12711)
We store the affinity mask in the native endian. However, over D-Bus we
must transfer the mask in little endian byte order.
This is the second part of c367f996f5f091a63f812f0140b304c649be77fc.
(cherry picked from commit 75e40119a471454516ad0acc96f6f4094e7fb652)
Related: #1740657
---
src/core/dbus-execute.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index f9527e56b2..d5acca384f 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -215,12 +215,15 @@ static int property_get_cpu_affinity(
sd_bus_error *error) {
ExecContext *c = userdata;
+ _cleanup_free_ uint8_t *array = NULL;
+ size_t allocated;
assert(bus);
assert(reply);
assert(c);
- return sd_bus_message_append_array(reply, 'y', c->cpu_set.set, c->cpu_set.allocated);
+ (void) cpu_set_to_dbus(&c->cpu_set, &array, &allocated);
+ return sd_bus_message_append_array(reply, 'y', array, allocated);
}
static int property_get_numa_mask(
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alpha-wang/systemd.git
git@gitee.com:alpha-wang/systemd.git
alpha-wang
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385