efivarfs: rename a couple of return params to ret_xyz/ret

This commit is contained in:
Lennart Poettering
2022-03-24 15:20:57 +01:00
parent afd1a45a16
commit 187513fd3a
2 changed files with 16 additions and 16 deletions
+11 -11
View File
@@ -142,7 +142,7 @@ int efi_get_variable(
return 0;
}
int efi_get_variable_string(const char *variable, char **p) {
int efi_get_variable_string(const char *variable, char **ret) {
_cleanup_free_ void *s = NULL;
size_t ss = 0;
int r;
@@ -156,7 +156,7 @@ int efi_get_variable_string(const char *variable, char **p) {
if (!x)
return -ENOMEM;
*p = x;
*ret = x;
return 0;
}
@@ -350,7 +350,7 @@ SecureBootMode efi_get_secure_boot_mode(void) {
return (cache = decode_secure_boot_mode(secure, audit > 0, deployed > 0, setup > 0));
}
static int read_efi_options_variable(char **line) {
static int read_efi_options_variable(char **ret) {
int r;
/* In SecureBoot mode this is probably not what you want. As your cmdline is cryptographically signed
@@ -370,7 +370,7 @@ static int read_efi_options_variable(char **line) {
return -EPERM;
}
r = efi_get_variable_string(EFI_SYSTEMD_VARIABLE(SystemdOptions), line);
r = efi_get_variable_string(EFI_SYSTEMD_VARIABLE(SystemdOptions), ret);
if (r == -ENOENT)
return -ENODATA;
return r;
@@ -388,13 +388,13 @@ int cache_efi_options_variable(void) {
WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MKDIR_0755);
}
int systemd_efi_options_variable(char **line) {
int systemd_efi_options_variable(char **ret) {
const char *e;
int r;
/* Returns the contents of the variable for current boot from the cache. */
assert(line);
assert(ret);
/* For testing purposes it is sometimes useful to be able to override this */
e = secure_getenv("SYSTEMD_EFI_OPTIONS");
@@ -405,11 +405,11 @@ int systemd_efi_options_variable(char **line) {
if (!m)
return -ENOMEM;
*line = m;
*ret = m;
return 0;
}
r = read_one_line_file(EFIVAR_CACHE_PATH(EFI_SYSTEMD_VARIABLE(SystemdOptions)), line);
r = read_one_line_file(EFIVAR_CACHE_PATH(EFI_SYSTEMD_VARIABLE(SystemdOptions)), ret);
if (r == -ENOENT)
return -ENODATA;
return r;
@@ -419,7 +419,7 @@ static inline int compare_stat_mtime(const struct stat *a, const struct stat *b)
return CMP(timespec_load(&a->st_mtim), timespec_load(&b->st_mtim));
}
int systemd_efi_options_efivarfs_if_newer(char **line) {
int systemd_efi_options_efivarfs_if_newer(char **ret) {
struct stat a = {}, b;
int r;
@@ -433,11 +433,11 @@ int systemd_efi_options_efivarfs_if_newer(char **line) {
log_debug("Variable SystemdOptions in evifarfs is newer than in cache.");
else {
log_debug("Variable SystemdOptions in cache is up to date.");
*line = NULL;
*ret = NULL;
return 0;
}
r = read_efi_options_variable(line);
r = read_efi_options_variable(ret);
if (r < 0)
return log_debug_errno(r, "Failed to read SystemdOptions EFI variable: %m");
+5 -5
View File
@@ -42,8 +42,8 @@
#if ENABLE_EFI
int efi_get_variable(const char *variable, uint32_t *attribute, void **value, size_t *size);
int efi_get_variable_string(const char *variable, char **p);
int efi_get_variable(const char *variable, uint32_t *attribute, void **ret_value, size_t *ret_size);
int efi_get_variable_string(const char *variable, char **ret);
int efi_set_variable(const char *variable, const void *value, size_t size);
int efi_set_variable_string(const char *variable, const char *p);
@@ -52,8 +52,8 @@ bool is_efi_secure_boot(void);
SecureBootMode efi_get_secure_boot_mode(void);
int cache_efi_options_variable(void);
int systemd_efi_options_variable(char **line);
int systemd_efi_options_efivarfs_if_newer(char **line);
int systemd_efi_options_variable(char **ret);
int systemd_efi_options_efivarfs_if_newer(char **ret);
#else
@@ -61,7 +61,7 @@ static inline int efi_get_variable(const char *variable, uint32_t *attribute, vo
return -EOPNOTSUPP;
}
static inline int efi_get_variable_string(const char *variable, char **p) {
static inline int efi_get_variable_string(const char *variable, char **ret) {
return -EOPNOTSUPP;
}