1 Star 0 Fork 98

温志伟/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-unit-coldplug-both-job-and-nop_job-if-possible.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
From 7dbd330c7ef28852db0fb044503ed6f072477d50 Mon Sep 17 00:00:00 2001
From: Geass-LL <shenxiaogll@163.com>
Date: Fri, 2 Apr 2021 11:27:59 +0800
Subject: [PATCH] unit: coldplug both job and nop_job if possible
Sometimes, both job and nop_job are deserialized. In this case,
if we only cold plug the job, the nop_job will also stuck in the
job list.
---
src/core/unit.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 7c39e4d0f8..2f7f022ef3 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3588,7 +3588,6 @@ int unit_add_blockdev_dependency(Unit *u, const char *what, UnitDependencyMask m
int unit_coldplug(Unit *u) {
int r = 0, q;
char **i;
- Job *uj;
assert(u);
@@ -3611,9 +3610,13 @@ int unit_coldplug(Unit *u) {
r = q;
}
- uj = u->job ?: u->nop_job;
- if (uj) {
- q = job_coldplug(uj);
+ if (u->job) {
+ q = job_coldplug(u->job);
+ if (q < 0 && r >= 0)
+ r = q;
+ }
+ if (u->nop_job) {
+ q = job_coldplug(u->nop_job);
if (q < 0 && r >= 0)
r = q;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wenzhiwei11/systemd.git
git@gitee.com:wenzhiwei11/systemd.git
wenzhiwei11
systemd
systemd
master

搜索帮助