From cb9f37eb33d161e2ac19260ae375d42d09931641 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 11:55:38 +0200 Subject: [PATCH 01/13] udev: fix argument comments for test_udev_rule_parse_value_one --- src/udev/test-udev-rules.c | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/udev/test-udev-rules.c b/src/udev/test-udev-rules.c index 9e8ae87a8c..031937347a 100644 --- a/src/udev/test-udev-rules.c +++ b/src/udev/test-udev-rules.c @@ -35,61 +35,61 @@ TEST(udev_rule_parse_value) { * parsed: valid operand * use the following command to help generate textual C strings: * python3 -c 'import json; print(json.dumps(input()))' */ - test_udev_rule_parse_value_one("\"valid operand\"", "valid operand", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("\"valid operand\"", "valid operand", /* expected_case_insensitive = */ false, 0); /* input: "va'l\'id\"op\"erand" * parsed: va'l\'id"op"erand */ - test_udev_rule_parse_value_one("\"va'l\\'id\\\"op\\\"erand\"", "va'l\\'id\"op\"erand", /* case_insensitive = */ false, 0); - test_udev_rule_parse_value_one("no quotes", NULL, /* case_insensitive = */ false, -EINVAL); - test_udev_rule_parse_value_one("\"\\\\a\\b\\x\\y\"", "\\\\a\\b\\x\\y", /* case_insensitive = */ false, 0); - test_udev_rule_parse_value_one("\"reject\0nul\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("\"va'l\\'id\\\"op\\\"erand\"", "va'l\\'id\"op\"erand", /* expected_case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("no quotes", NULL, /* expected_case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("\"\\\\a\\b\\x\\y\"", "\\\\a\\b\\x\\y", /* expected_case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("\"reject\0nul\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: e"" */ - test_udev_rule_parse_value_one("e\"\"", "", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"\"", "", /* expected_case_insensitive = */ false, 0); /* input: e"1234" */ - test_udev_rule_parse_value_one("e\"1234\"", "1234", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"1234\"", "1234", /* expected_case_insensitive = */ false, 0); /* input: e"\"" */ - test_udev_rule_parse_value_one("e\"\\\"\"", "\"", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"\\\"\"", "\"", /* expected_case_insensitive = */ false, 0); /* input: e"\ */ - test_udev_rule_parse_value_one("e\"\\", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("e\"\\", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: e"\" */ - test_udev_rule_parse_value_one("e\"\\\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("e\"\\\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: e"\\" */ - test_udev_rule_parse_value_one("e\"\\\\\"", "\\", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"\\\\\"", "\\", /* expected_case_insensitive = */ false, 0); /* input: e"\\\" */ - test_udev_rule_parse_value_one("e\"\\\\\\\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("e\"\\\\\\\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: e"\\\"" */ - test_udev_rule_parse_value_one("e\"\\\\\\\"\"", "\\\"", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"\\\\\\\"\"", "\\\"", /* expected_case_insensitive = */ false, 0); /* input: e"\\\\" */ - test_udev_rule_parse_value_one("e\"\\\\\\\\\"", "\\\\", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"\\\\\\\\\"", "\\\\", /* expected_case_insensitive = */ false, 0); /* input: e"operand with newline\n" */ - test_udev_rule_parse_value_one("e\"operand with newline\\n\"", "operand with newline\n", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"operand with newline\\n\"", "operand with newline\n", /* expected_case_insensitive = */ false, 0); /* input: e"single\rcharacter\t\aescape\bsequence" */ test_udev_rule_parse_value_one( - "e\"single\\rcharacter\\t\\aescape\\bsequence\"", "single\rcharacter\t\aescape\bsequence", /* case_insensitive = */ false, 0); + "e\"single\\rcharacter\\t\\aescape\\bsequence\"", "single\rcharacter\t\aescape\bsequence", /* expected_case_insensitive = */ false, 0); /* input: e"reject\invalid escape sequence" */ - test_udev_rule_parse_value_one("e\"reject\\invalid escape sequence", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("e\"reject\\invalid escape sequence", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: e"\ */ - test_udev_rule_parse_value_one("e\"\\", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("e\"\\", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: "s\u1d1c\u1d04\u029c \u1d1c\u0274\u026a\u1d04\u1d0f\u1d05\u1d07 \U0001d568\U0001d560\U0001d568" */ test_udev_rule_parse_value_one( "e\"s\\u1d1c\\u1d04\\u029c \\u1d1c\\u0274\\u026a\\u1d04\\u1d0f\\u1d05\\u1d07 \\U0001d568\\U0001d560\\U0001d568\"", "s\xe1\xb4\x9c\xe1\xb4\x84\xca\x9c \xe1\xb4\x9c\xc9\xb4\xc9\xaa\xe1\xb4\x84\xe1\xb4\x8f\xe1\xb4\x85\xe1\xb4\x87 \xf0\x9d\x95\xa8\xf0\x9d\x95\xa0\xf0\x9d\x95\xa8", - /* case_insensitive = */ false, 0); + /* expected_case_insensitive = */ false, 0); /* input: i"ABCD1234" */ - test_udev_rule_parse_value_one("i\"ABCD1234\"", "ABCD1234", /* case_insensitive = */ true, 0); + test_udev_rule_parse_value_one("i\"ABCD1234\"", "ABCD1234", /* expected_case_insensitive = */ true, 0); /* input: i"ABCD1234" */ - test_udev_rule_parse_value_one("e\"ABCD1234\"", "ABCD1234", /* case_insensitive = */ false, 0); + test_udev_rule_parse_value_one("e\"ABCD1234\"", "ABCD1234", /* expected_case_insensitive = */ false, 0); /* input: ei"\\"ABCD1234 */ - test_udev_rule_parse_value_one("ei\"\\\\ABCD1234\"", "\\ABCD1234", /* case_insensitive = */ true, 0); + test_udev_rule_parse_value_one("ei\"\\\\ABCD1234\"", "\\ABCD1234", /* expected_case_insensitive = */ true, 0); /* input: ie"\\"ABCD1234 */ - test_udev_rule_parse_value_one("ie\"\\\\ABCD1234\"", "\\ABCD1234", /* case_insensitive = */ true, 0); + test_udev_rule_parse_value_one("ie\"\\\\ABCD1234\"", "\\ABCD1234", /* expected_case_insensitive = */ true, 0); /* input: i */ - test_udev_rule_parse_value_one("i", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("i", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: ee"" */ - test_udev_rule_parse_value_one("ee\"\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("ee\"\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: iei"" */ - test_udev_rule_parse_value_one("iei\"\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("iei\"\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); /* input: a"" */ - test_udev_rule_parse_value_one("a\"\"", NULL, /* case_insensitive = */ false, -EINVAL); + test_udev_rule_parse_value_one("a\"\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); } DEFINE_TEST_MAIN(LOG_DEBUG); From 14a07ec3585b621c3dc5d73cb5cd23fdeba03a8f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 12:05:30 +0200 Subject: [PATCH 02/13] vmspawn: correct argument comment --- src/vmspawn/vmspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 7c12b5e612..6eee96f6e4 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -2337,7 +2337,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { const char *e = secure_getenv("SYSTEMD_VMSPAWN_QEMU_EXTRA"); if (e) { r = strv_split_and_extend_full(&cmdline, e, - /* separator = */ NULL, /* filter_duplicates = */ false, + /* separators = */ NULL, /* filter_duplicates = */ false, EXTRACT_CUNESCAPE|EXTRACT_UNQUOTE); if (r < 0) return log_error_errno(r, "Failed to parse $SYSTEMD_VMSPAWN_QEMU_EXTRA: %m"); From b52f095e9a4291cade54031522a60b910059416f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 12:14:02 +0200 Subject: [PATCH 03/13] shared: bootspec: use argument comment name auto_only --- src/shared/bootspec.c | 4 ++-- src/shared/bootspec.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 5dd8d452ab..8b9411a5c2 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1565,7 +1565,7 @@ int boot_config_load_auto( int boot_config_augment_from_loader( BootConfig *config, char **found_by_loader, - bool only_auto) { + bool auto_only) { static const BootEntryAddons no_addons = (BootEntryAddons) {}; static const char *const title_table[] = { @@ -1595,7 +1595,7 @@ int boot_config_augment_from_loader( continue; } - if (only_auto && !startswith(*i, "auto-")) + if (auto_only && !startswith(*i, "auto-")) continue; c = strdup(*i); diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 1d114e10d4..a574a0be93 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -132,7 +132,7 @@ int boot_config_load_type1( int boot_config_finalize(BootConfig *config); int boot_config_load(BootConfig *config, const char *esp_path, const char *xbootldr_path); int boot_config_load_auto(BootConfig *config, const char *override_esp_path, const char *override_xbootldr_path); -int boot_config_augment_from_loader(BootConfig *config, char **list, bool only_auto); +int boot_config_augment_from_loader(BootConfig *config, char **list, bool auto_only); int boot_config_select_special_entries(BootConfig *config, bool skip_efivars); From deed695faa0fcb9b8cbd21c5952097179f1bd427 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 12:17:01 +0200 Subject: [PATCH 04/13] shared: dissect-image: use argument comment name label --- src/shared/dissect-image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 7d04e23cd2..30a8dec036 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -669,7 +669,7 @@ static int compare_arch(Architecture a, Architecture b) { return 0; } -static bool image_filter_test(const ImageFilter *filter, PartitionDesignator d, const char *name) { +static bool image_filter_test(const ImageFilter *filter, PartitionDesignator d, const char *label) { assert(d < _PARTITION_DESIGNATOR_MAX); if (d < 0) /* For unspecified designators we have no filter expression */ @@ -678,7 +678,7 @@ static bool image_filter_test(const ImageFilter *filter, PartitionDesignator d, if (!filter || !filter->pattern[d]) return true; - return fnmatch(filter->pattern[d], strempty(name), FNM_NOESCAPE) == 0; + return fnmatch(filter->pattern[d], strempty(label), FNM_NOESCAPE) == 0; } static int dissect_image( From 5073b0dd87abe1b79c42fc4490540f005fb1c422 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 12:20:34 +0200 Subject: [PATCH 05/13] test: correct argument comment simplified --- src/test/test-image-policy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/test-image-policy.c b/src/test/test-image-policy.c index 7134f3d1d0..c1747f3440 100644 --- a/src/test/test-image-policy.c +++ b/src/test/test-image-policy.c @@ -10,8 +10,8 @@ static void test_policy(const ImagePolicy *p, const char *name) { _cleanup_free_ char *as_string = NULL, *as_string_simplified = NULL; _cleanup_free_ ImagePolicy *parsed = NULL; - assert_se(image_policy_to_string(p, /* simplified= */ false, &as_string) >= 0); - assert_se(image_policy_to_string(p, /* simplified= */ true, &as_string_simplified) >= 0); + assert_se(image_policy_to_string(p, /* simplify= */ false, &as_string) >= 0); + assert_se(image_policy_to_string(p, /* simplify= */ true, &as_string_simplified) >= 0); printf("%s%s", ansi_underline(), name); @@ -40,17 +40,17 @@ static void test_policy(const ImagePolicy *p, const char *name) { if (f < 0) { f = image_policy_get_exhaustively(p, d); assert_se(f >= 0); - assert_se(partition_policy_flags_to_string(f, /* simplified= */ true, &k) >= 0); + assert_se(partition_policy_flags_to_string(f, /* simplify= */ true, &k) >= 0); printf("%s\t%s → n/a (exhaustively: %s)%s\n", ansi_grey(), partition_designator_to_string(d), k, ansi_normal()); } else { - assert_se(partition_policy_flags_to_string(f, /* simplified= */ true, &k) >= 0); + assert_se(partition_policy_flags_to_string(f, /* simplify= */ true, &k) >= 0); printf("\t%s → %s\n", partition_designator_to_string(d), k); } } _cleanup_free_ char *w = NULL; - assert_se(partition_policy_flags_to_string(image_policy_default(p), /* simplified= */ true, &w) >= 0); + assert_se(partition_policy_flags_to_string(image_policy_default(p), /* simplify= */ true, &w) >= 0); printf("\tdefault → %s\n", w); } From b72c29b6c7149cb938ec876bcb8c6444c2947411 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 12:22:46 +0200 Subject: [PATCH 06/13] network: correct argument comment may_keep_dhcp --- src/network/networkd-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index f81e88fbc3..58614a5d26 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1437,7 +1437,7 @@ int link_reconfigure_impl(Link *link, LinkReconfigurationFlag flags) { } else { /* Otherwise, stop DHCP client and friends unconditionally, and drop all dynamic * configurations like DHCP address and routes. */ - r = link_stop_engines(link, /* may_keep_dhcp = */ false); + r = link_stop_engines(link, /* may_keep_dynamic = */ false); if (r < 0) return r; From 88a66cfbd59336116184ed8aeafa945137e9f022 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 19:11:16 +0200 Subject: [PATCH 07/13] hostname: use argument comment name transient_hostname --- src/hostname/hostnamed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 1bfd14b0d8..5fe4e7e07f 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -685,7 +685,7 @@ static char* context_fallback_icon_name(Context *c) { static int context_update_kernel_hostname( Context *c, - const char *transient_hn) { + const char *transient_hostname) { _cleanup_free_ char *_hn_free = NULL; const char *hn; @@ -700,8 +700,8 @@ static int context_update_kernel_hostname( hns = HOSTNAME_STATIC; /* ... the transient hostname, (ie: DHCP) comes next ... */ - } else if (transient_hn) { - hn = transient_hn; + } else if (transient_hostname) { + hn = transient_hostname; hns = HOSTNAME_TRANSIENT; /* ... and the ultimate fallback */ From 4827c9fde8972c4d7cc038bf202b2d0b1750f3c8 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 19:15:04 +0200 Subject: [PATCH 08/13] basic: fix argument naming for vt_release --- src/basic/terminal-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index 3f6c376770..d008d0456c 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -143,7 +143,7 @@ int openpt_allocate(int flags, char **ret_peer); int openpt_allocate_in_namespace(const PidRef *pidref, int flags, char **ret_peer); int vt_restore(int fd); -int vt_release(int fd, bool restore_vt); +int vt_release(int fd, bool restore); void get_log_colors(int priority, const char **on, const char **off, const char **highlight); From 09755ba51134bd5128e142ef16530060547636d3 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 19:22:31 +0200 Subject: [PATCH 09/13] treewide: fix argument comment for getxattr_at_bool --- src/basic/cgroup-util.c | 6 +++--- src/basic/os-util.c | 2 +- src/random-seed/random-seed.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index aa88975bd9..2cbfab8cff 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -701,7 +701,7 @@ int cg_get_xattr_bool(const char *path, const char *name) { if (r < 0) return r; - return getxattr_at_bool(AT_FDCWD, fs, name, /* flags= */ 0); + return getxattr_at_bool(AT_FDCWD, fs, name, /* at_flags= */ 0); } int cg_remove_xattr(const char *path, const char *name) { @@ -2176,11 +2176,11 @@ int cg_is_delegated_fd(int fd) { assert(fd >= 0); - r = getxattr_at_bool(fd, /* path= */ NULL, "trusted.delegate", /* flags= */ 0); + r = getxattr_at_bool(fd, /* path= */ NULL, "trusted.delegate", /* at_flags= */ 0); if (!ERRNO_IS_NEG_XATTR_ABSENT(r)) return r; - r = getxattr_at_bool(fd, /* path= */ NULL, "user.delegate", /* flags= */ 0); + r = getxattr_at_bool(fd, /* path= */ NULL, "user.delegate", /* at_flags= */ 0); return ERRNO_IS_NEG_XATTR_ABSENT(r) ? false : r; } diff --git a/src/basic/os-util.c b/src/basic/os-util.c index cc6b0a7f51..3187c0bd9f 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -123,7 +123,7 @@ static int extension_release_strict_xattr_value(int extension_release_fd, const assert(filename); /* No xattr or cannot parse it? Then skip this. */ - r = getxattr_at_bool(extension_release_fd, /* path= */ NULL, "user.extension-release.strict", /* flags= */ 0); + r = getxattr_at_bool(extension_release_fd, /* path= */ NULL, "user.extension-release.strict", /* at_flags= */ 0); if (ERRNO_IS_NEG_XATTR_ABSENT(r)) return log_debug_errno(r, "%s/%s does not have user.extension-release.strict xattr, ignoring.", extension_release_dir_path, filename); diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index 8ba359c93a..75e3405676 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -73,7 +73,7 @@ static CreditEntropy may_credit(int seed_fd) { } /* Determine if the file is marked as creditable */ - r = getxattr_at_bool(seed_fd, /* path= */ NULL, "user.random-seed-creditable", /* flags= */ 0); + r = getxattr_at_bool(seed_fd, /* path= */ NULL, "user.random-seed-creditable", /* at_flags= */ 0); if (r < 0) { if (ERRNO_IS_XATTR_ABSENT(r)) log_debug_errno(r, "Seed file is not marked as creditable, not crediting."); From ac54e84a4e1df1064f91ab5ba7b9602c6e802b8f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 19:34:11 +0200 Subject: [PATCH 10/13] ask-password-api: use flags consistently as argument name --- src/shared/ask-password-api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/ask-password-api.h b/src/shared/ask-password-api.h index 03c6d1abdb..f39a3459d6 100644 --- a/src/shared/ask-password-api.h +++ b/src/shared/ask-password-api.h @@ -34,7 +34,7 @@ typedef struct AskPasswordRequest { int ask_password_tty(const AskPasswordRequest *req, AskPasswordFlags flags, char ***ret); int ask_password_plymouth(const AskPasswordRequest *req, AskPasswordFlags flags, char ***ret); -int ask_password_agent(const AskPasswordRequest *req, AskPasswordFlags flag, char ***ret); -int ask_password_auto(const AskPasswordRequest *req, AskPasswordFlags flag, char ***ret); +int ask_password_agent(const AskPasswordRequest *req, AskPasswordFlags flags, char ***ret); +int ask_password_auto(const AskPasswordRequest *req, AskPasswordFlags flags, char ***ret); int acquire_user_ask_password_directory(char **ret); From 3e1ff91fd6553e008c571d4e81c53baf2e9cf5df Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 7 May 2025 19:53:18 +0200 Subject: [PATCH 11/13] shared/cred-util: fix argument comment for copy_file_at --- src/shared/creds-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/creds-util.c b/src/shared/creds-util.c index 6eca4aa88c..e72df30eb9 100644 --- a/src/shared/creds-util.c +++ b/src/shared/creds-util.c @@ -1758,7 +1758,7 @@ static int pick_up_credential_one( AT_FDCWD, target_path, /* open_flags= */ 0, 0644, - /* flags= */ 0); + /* copy_flags= */ 0); if (r < 0) return log_warning_errno(r, "Failed to copy credential %s → file %s: %m", credential_name, target_path); From 39f4686045499ef7126c910d43281b4a9eb50004 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Fri, 9 May 2025 15:42:26 +0200 Subject: [PATCH 12/13] basic: fix consistency of flags argument for chase and chaseat Both functions have one flags argument, so we don't need to rename them to `chase_flags`. --- src/basic/chase.h | 2 +- src/basic/terminal-util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/chase.h b/src/basic/chase.h index eda7cad0b7..2146f54e7a 100644 --- a/src/basic/chase.h +++ b/src/basic/chase.h @@ -38,7 +38,7 @@ bool unsafe_transition(const struct stat *a, const struct stat *b); /* How many iterations to execute before returning -ELOOP */ #define CHASE_MAX 32 -int chase(const char *path_with_prefix, const char *root, ChaseFlags chase_flags, char **ret_path, int *ret_fd); +int chase(const char *path_with_prefix, const char *root, ChaseFlags flags, char **ret_path, int *ret_fd); int chaseat_prefix_root(const char *path, const char *root, char **ret); int chase_extract_filename(const char *path, const char *root, char **ret); diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index acd2538952..7c900c267d 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -1119,7 +1119,7 @@ int resolve_dev_console(char **ret) { * is a sign for container setups). */ _cleanup_free_ char *chased = NULL; - r = chase("/dev/console", /* root= */ NULL, /* chase_flags= */ 0, &chased, /* ret_fd= */ NULL); + r = chase("/dev/console", /* root= */ NULL, /* flags= */ 0, &chased, /* ret_fd= */ NULL); if (r < 0) return r; if (!path_equal(chased, "/dev/console")) { From 2a1a6e5dd001c4fccb40c7b375fbc73c2a271c08 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Fri, 9 May 2025 15:47:00 +0200 Subject: [PATCH 13/13] sd-device: fix argument comment chase_flags --- src/libsystemd/sd-device/sd-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 12763f53b5..3e50bc7768 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -563,7 +563,7 @@ static int device_new_from_devname(sd_device **ret, const char *devname, bool st _cleanup_free_ char *resolved = NULL; struct stat st; - r = chase_and_stat(devname, /* root = */ NULL, /* flags = */ 0, &resolved, &st); + r = chase_and_stat(devname, /* root = */ NULL, /* chase_flags = */ 0, &resolved, &st); if (ERRNO_IS_NEG_DEVICE_ABSENT(r)) return -ENODEV; if (r < 0)