From: Lennart Poettering Date: Fri, 2 Sep 2022 09:40:26 +0000 (+0200) Subject: bootspec: rename "id" function parameters to "fname" X-Git-Tag: v252-rc1~268^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f70de82f9f5883ee35baccc70bd3120ebf397385;p=thirdparty%2Fsystemd.git bootspec: rename "id" function parameters to "fname" It's really the file name, so name it like that. Just some renaming. (This is preparation for later work, to extract tries-done/tries-left info from filenames) --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 3ca65454c1a..3ae05719a25 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -173,7 +173,7 @@ static int boot_entry_load_type1( FILE *f, const char *root, const char *dir, - const char *id, + const char *fname, BootEntry *entry) { _cleanup_(boot_entry_free) BootEntry tmp = { @@ -187,27 +187,27 @@ static int boot_entry_load_type1( assert(f); assert(root); assert(dir); - assert(id); + assert(fname); assert(entry); /* Loads a Type #1 boot menu entry from the specified FILE* object */ - if (!efi_loader_entry_name_valid(id)) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid loader entry name: %s", id); + if (!efi_loader_entry_name_valid(fname)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid loader entry name: %s", fname); - c = endswith_no_case(id, ".conf"); + c = endswith_no_case(fname, ".conf"); if (!c) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid loader entry file suffix: %s", id); + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid loader entry file suffix: %s", fname); - tmp.id = strdup(id); + tmp.id = strdup(fname); if (!tmp.id) return log_oom(); - tmp.id_old = strndup(id, c - id); /* Without .conf suffix */ + tmp.id_old = strndup(fname, c - fname); /* Without .conf suffix */ if (!tmp.id_old) return log_oom(); - tmp.path = path_join(dir, id); + tmp.path = path_join(dir, fname); if (!tmp.path) return log_oom(); @@ -291,19 +291,19 @@ int boot_config_load_type1( FILE *f, const char *root, const char *dir, - const char *id) { + const char *fname) { int r; assert(config); assert(f); assert(root); assert(dir); - assert(id); + assert(fname); if (!GREEDY_REALLOC0(config->entries, config->n_entries + 1)) return log_oom(); - r = boot_entry_load_type1(f, root, dir, id, config->entries + config->n_entries); + r = boot_entry_load_type1(f, root, dir, fname, config->entries + config->n_entries); if (r < 0) return r;