代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From f7940c9cdf872d7504aca9637e9fd14328b2b726 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 19 Apr 2022 11:26:10 +0800
Subject: [PATCH] exit-status: introduce EXIT_EXCEPTION mapping to 255
---
src/basic/exit-status.c | 9 ++++++---
src/basic/exit-status.h | 1 +
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/basic/exit-status.c b/src/basic/exit-status.c
index 0a7a53b..8b67d44 100644
--- a/src/basic/exit-status.c
+++ b/src/basic/exit-status.c
@@ -19,9 +19,9 @@ const char* exit_status_to_string(int status, ExitStatusLevel level) {
* 79…199 │ (Currently unmapped)
* 200…241 │ systemd's private error codes (might be extended to 254 in future development)
* 242…254 │ (Currently unmapped, but see above)
- * 255 │ (We should probably stay away from that one, it's frequently used by applications to indicate an
- * │ exit reason that cannot really be expressed in a single exit status value — such as a propagated
- * │ signal or such)
+ * 255 │ EXIT_EXCEPTION (We use this to propagate exit-by-signal events. It's frequently used by others apps (like bash)
+ * │ to indicate exit reason that cannot really be expressed in a single exit status value — such as a propagated
+ * │ signal or such, and we follow that logic here.)
*/
switch (status) { /* We always cover the ISO C ones */
@@ -158,6 +158,9 @@ const char* exit_status_to_string(int status, ExitStatusLevel level) {
case EXIT_NUMA_POLICY:
return "NUMA_POLICY";
+
+ case EXIT_EXCEPTION:
+ return "EXCEPTION";
}
}
diff --git a/src/basic/exit-status.h b/src/basic/exit-status.h
index dc284aa..e923247 100644
--- a/src/basic/exit-status.h
+++ b/src/basic/exit-status.h
@@ -70,6 +70,7 @@ enum {
EXIT_LOGS_DIRECTORY, /* 240 */
EXIT_CONFIGURATION_DIRECTORY,
EXIT_NUMA_POLICY,
+ EXIT_EXCEPTION = 255, /* Whenever we want to propagate an abnormal/signal exit, in line with bash */
};
typedef enum ExitStatusLevel {
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。