|
|
ddca0b |
From 0577d8378645c1ecd909b74403cefe31ed569398 Mon Sep 17 00:00:00 2001
|
|
|
ddca0b |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
ddca0b |
Date: Thu, 1 Aug 2019 08:13:13 +0200
|
|
|
ddca0b |
Subject: [PATCH] cryptsetup: use unabbrieviated variable names
|
|
|
ddca0b |
|
|
|
ddca0b |
Now that "ret_" has been added to the output variables, we can name
|
|
|
ddca0b |
the internal variables without artificial abbrevs.
|
|
|
ddca0b |
|
|
|
ddca0b |
(cherry picked from commit 5d2100dc4c32abbce4109e75cbfbbef6e1b2b7b1)
|
|
|
ddca0b |
|
|
|
ddca0b |
Related: #1763155
|
|
|
ddca0b |
---
|
|
|
ddca0b |
src/cryptsetup/cryptsetup-generator.c | 26 +++++++++++++-------------
|
|
|
ddca0b |
1 file changed, 13 insertions(+), 13 deletions(-)
|
|
|
ddca0b |
|
|
|
ddca0b |
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
|
|
|
ddca0b |
index 1e8e3ba00d..7b234e37be 100644
|
|
|
ddca0b |
--- a/src/cryptsetup/cryptsetup-generator.c
|
|
|
ddca0b |
+++ b/src/cryptsetup/cryptsetup-generator.c
|
|
|
ddca0b |
@@ -40,30 +40,30 @@ static Hashmap *arg_disks = NULL;
|
|
|
ddca0b |
static char *arg_default_options = NULL;
|
|
|
ddca0b |
static char *arg_default_keyfile = NULL;
|
|
|
ddca0b |
|
|
|
ddca0b |
-static int split_keyspec(const char *keyspec, char **keyfile, char **keydev) {
|
|
|
ddca0b |
- _cleanup_free_ char *kfile = NULL, *kdev = NULL;
|
|
|
ddca0b |
- char *c;
|
|
|
ddca0b |
+static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
|
|
|
ddca0b |
+ _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
|
|
|
ddca0b |
+ const char *c;
|
|
|
ddca0b |
|
|
|
ddca0b |
assert(keyspec);
|
|
|
ddca0b |
- assert(keyfile);
|
|
|
ddca0b |
- assert(keydev);
|
|
|
ddca0b |
+ assert(ret_keyfile);
|
|
|
ddca0b |
+ assert(ret_keydev);
|
|
|
ddca0b |
|
|
|
ddca0b |
c = strrchr(keyspec, ':');
|
|
|
ddca0b |
if (c) {
|
|
|
ddca0b |
- kfile = strndup(keyspec, c-keyspec);
|
|
|
ddca0b |
- kdev = strdup(c + 1);
|
|
|
ddca0b |
- if (!*kfile || !*kdev)
|
|
|
ddca0b |
+ keyfile = strndup(keyspec, c-keyspec);
|
|
|
ddca0b |
+ keydev = strdup(c + 1);
|
|
|
ddca0b |
+ if (!keyfile || !keydev)
|
|
|
ddca0b |
return log_oom();
|
|
|
ddca0b |
} else {
|
|
|
ddca0b |
/* No keydev specified */
|
|
|
ddca0b |
- kfile = strdup(keyspec);
|
|
|
ddca0b |
- kdev = NULL;
|
|
|
ddca0b |
- if (!*kfile)
|
|
|
ddca0b |
+ keyfile = strdup(keyspec);
|
|
|
ddca0b |
+ keydev = NULL;
|
|
|
ddca0b |
+ if (!keyfile)
|
|
|
ddca0b |
return log_oom();
|
|
|
ddca0b |
}
|
|
|
ddca0b |
|
|
|
ddca0b |
- *keyfile = TAKE_PTR(kfile);
|
|
|
ddca0b |
- *keydev = TAKE_PTR(kdev);
|
|
|
ddca0b |
+ *ret_keyfile = TAKE_PTR(keyfile);
|
|
|
ddca0b |
+ *ret_keydev = TAKE_PTR(keydev);
|
|
|
ddca0b |
|
|
|
ddca0b |
return 0;
|
|
|
ddca0b |
}
|