1 Star 0 Fork 50

lxpzero/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0299-cryptsetup-use-unabbrieviated-variable-names.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:59 . import systemd-239-29.el8.src.rpm
From 0577d8378645c1ecd909b74403cefe31ed569398 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 1 Aug 2019 08:13:13 +0200
Subject: [PATCH] cryptsetup: use unabbrieviated variable names
Now that "ret_" has been added to the output variables, we can name
the internal variables without artificial abbrevs.
(cherry picked from commit 5d2100dc4c32abbce4109e75cbfbbef6e1b2b7b1)
Related: #1763155
---
src/cryptsetup/cryptsetup-generator.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 1e8e3ba00d..7b234e37be 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -40,30 +40,30 @@ static Hashmap *arg_disks = NULL;
static char *arg_default_options = NULL;
static char *arg_default_keyfile = NULL;
-static int split_keyspec(const char *keyspec, char **keyfile, char **keydev) {
- _cleanup_free_ char *kfile = NULL, *kdev = NULL;
- char *c;
+static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
+ _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
+ const char *c;
assert(keyspec);
- assert(keyfile);
- assert(keydev);
+ assert(ret_keyfile);
+ assert(ret_keydev);
c = strrchr(keyspec, ':');
if (c) {
- kfile = strndup(keyspec, c-keyspec);
- kdev = strdup(c + 1);
- if (!*kfile || !*kdev)
+ keyfile = strndup(keyspec, c-keyspec);
+ keydev = strdup(c + 1);
+ if (!keyfile || !keydev)
return log_oom();
} else {
/* No keydev specified */
- kfile = strdup(keyspec);
- kdev = NULL;
- if (!*kfile)
+ keyfile = strdup(keyspec);
+ keydev = NULL;
+ if (!keyfile)
return log_oom();
}
- *keyfile = TAKE_PTR(kfile);
- *keydev = TAKE_PTR(kdev);
+ *ret_keyfile = TAKE_PTR(keyfile);
+ *ret_keydev = TAKE_PTR(keydev);
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lxpzero/systemd.git
git@gitee.com:lxpzero/systemd.git
lxpzero
systemd
systemd
a8

搜索帮助