1 Star 0 Fork 49

wangkaiyuan/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0924-errno-util-introduce-ERRNO_IS_TRANSIENT.patch 917 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-12-26 10:07 . update to systemd-239-78.src.rpm
From 5a1d30b9a775a7bbac55752abdc10ed5383d209f Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 30 Nov 2021 03:39:35 +0900
Subject: [PATCH] errno-util: introduce ERRNO_IS_TRANSIENT()
(cherry picked from commit 7aad83580fccee926d903bdb1a2a6af2c40ef0fc)
Related: #2172846
---
src/basic/util.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/basic/util.h b/src/basic/util.h
index 195f02cf5f..48beb88bac 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -180,6 +180,14 @@ static inline int negative_errno(void) {
return -errno;
}
+
+/* For send()/recv() or read()/write(). */
+static inline bool ERRNO_IS_TRANSIENT(int r) {
+ return IN_SET(abs(r),
+ EAGAIN,
+ EINTR);
+}
+
/* Two different errors for access problems */
static inline bool ERRNO_IS_PRIVILEGE(int r) {
return IN_SET(abs(r),
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangkaiyuan01/systemd.git
git@gitee.com:wangkaiyuan01/systemd.git
wangkaiyuan01
systemd
systemd
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385