diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt index 864cc92b701..fc0a2d6a62e 100644 --- a/.github/workflows/requirements.txt +++ b/.github/workflows/requirements.txt @@ -1,20 +1,22 @@ meson==1.9.1 \ --hash=sha256:f824ab770c041a202f532f69e114c971918ed2daff7ea56583d80642564598d0 -ninja==1.11.1.4 \ - --hash=sha256:055f386fb550c2c9d6157e45e20a84d29c47968876b9c5794ae2aec46f952306 \ - --hash=sha256:096487995473320de7f65d622c3f1d16c3ad174797602218ca8c967f51ec38a0 \ - --hash=sha256:2ab67a41c90bea5ec4b795bab084bc0b3b3bb69d3cd21ca0294fc0fc15a111eb \ - --hash=sha256:4617b3c12ff64b611a7d93fd9e378275512bb36eff8babff7c83f5116b4f8d66 \ - --hash=sha256:5713cf50c5be50084a8693308a63ecf9e55c3132a78a41ab1363a28b6caaaee1 \ - --hash=sha256:6aa39f6e894e0452e5b297327db00019383ae55d5d9c57c73b04f13bf79d438a \ - --hash=sha256:9c29bb66d2aa46a2409ab369ea804c730faec7652e8c22c1e428cc09216543e5 \ - --hash=sha256:b33923c8da88e8da20b6053e38deb433f53656441614207e01d283ad02c5e8e7 \ - --hash=sha256:c3b96bd875f3ef1db782470e9e41d7508905a0986571f219d20ffed238befa15 \ - --hash=sha256:cede0af00b58e27b31f2482ba83292a8e9171cdb9acc2c867a3b6e40b3353e43 \ - --hash=sha256:cf4453679d15babc04ba023d68d091bb613091b67101c88f85d2171c6621c6eb \ - --hash=sha256:cf554e73f72c04deb04d0cf51f5fdb1903d9c9ca3d2344249c8ce3bd616ebc02 \ - --hash=sha256:cfdd09776436a1ff3c4a2558d3fc50a689fb9d7f1bdbc3e6f7b8c2991341ddb3 \ - --hash=sha256:d3090d4488fadf6047d0d7a1db0c9643a8d391f0d94729554dbb89b5bdc769d7 \ - --hash=sha256:d4a6f159b08b0ac4aca5ee1572e3e402f969139e71d85d37c0e2872129098749 \ - --hash=sha256:ecce44a00325a93631792974659cf253a815cc6da4ec96f89742925dfc295a0d \ - --hash=sha256:f6186d7607bb090c3be1e10c8a56b690be238f953616626f5032238c66e56867 +ninja==1.13.0 \ + --hash=sha256:11be2d22027bde06f14c343f01d31446747dbb51e72d00decca2eb99be911e2f \ + --hash=sha256:1c97223cdda0417f414bf864cfb73b72d8777e57ebb279c5f6de368de0062988 \ + --hash=sha256:3c0b40b1f0bba764644385319028650087b4c1b18cdfa6f45cb39a3669b81aa9 \ + --hash=sha256:3d00c692fb717fd511abeb44b8c5d00340c36938c12d6538ba989fe764e79630 \ + --hash=sha256:3d7d7779d12cb20c6d054c61b702139fd23a7a964ec8f2c823f1ab1b084150db \ + --hash=sha256:4a40ce995ded54d9dc24f8ea37ff3bf62ad192b547f6c7126e7e25045e76f978 \ + --hash=sha256:4be9c1b082d244b1ad7ef41eb8ab088aae8c109a9f3f0b3e56a252d3e00f42c1 \ + --hash=sha256:5f8e1e8a1a30835eeb51db05cf5a67151ad37542f5a4af2a438e9490915e5b72 \ + --hash=sha256:60056592cf495e9a6a4bea3cd178903056ecb0943e4de45a2ea825edb6dc8d3e \ + --hash=sha256:6739d3352073341ad284246f81339a384eec091d9851a886dfa5b00a6d48b3e2 \ + --hash=sha256:8cfbb80b4a53456ae8a39f90ae3d7a2129f45ea164f43fadfa15dc38c4aef1c9 \ + --hash=sha256:aa45b4037b313c2f698bc13306239b8b93b4680eb47e287773156ac9e9304714 \ + --hash=sha256:b4f2a072db3c0f944c32793e91532d8948d20d9ab83da9c0c7c15b5768072200 \ + --hash=sha256:be7f478ff9f96a128b599a964fc60a6a87b9fa332ee1bd44fa243ac88d50291c \ + --hash=sha256:d741a5e6754e0bda767e3274a0f0deeef4807f1fec6c0d7921a0244018926ae5 \ + --hash=sha256:e8bad11f8a00b64137e9b315b137d8bb6cbf3086fbdc43bf1f90fd33324d2e96 \ + --hash=sha256:fa2a8bfc62e31b08f83127d1613d10821775a0eb334197154c4d6067b7068ff1 \ + --hash=sha256:fb46acf6b93b8dd0322adc3a4945452a4e774b75b91293bafcc7b7f8e6517dfa \ + --hash=sha256:fb8ee8719f8af47fed145cced4a85f0755dd55d45b2bddaf7431fa89803c5f3e diff --git a/src/analyze/analyze-blame.c b/src/analyze/analyze-blame.c index 7476342caa5..b2350b14467 100644 --- a/src/analyze/analyze-blame.c +++ b/src/analyze/analyze-blame.c @@ -20,7 +20,7 @@ int verb_blame(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_connect_error(r, arg_transport, arg_runtime_scope); - n = acquire_time_data(bus, /* require_finished= */ false, ×); + n = acquire_time_data(bus, /* require_finished = */ false, ×); if (n <= 0) return n; diff --git a/src/analyze/analyze-condition.c b/src/analyze/analyze-condition.c index 17d3126b7ba..637a34e3895 100644 --- a/src/analyze/analyze-condition.c +++ b/src/analyze/analyze-condition.c @@ -17,7 +17,7 @@ static int parse_condition(Unit *u, const char *line) { assert(u); assert(line); - line = skip_leading_chars(line, /* bad= */ NULL); + line = skip_leading_chars(line, /* bad = */ NULL); const char *eq = strchr(line, '='); if (!eq) @@ -27,7 +27,7 @@ static int parse_condition(Unit *u, const char *line) { if (!type_string) return log_oom(); - delete_trailing_chars(type_string, /* bad= */ NULL); + delete_trailing_chars(type_string, /* bad = */ NULL); Condition **target; ConditionType type; @@ -41,7 +41,7 @@ static int parse_condition(Unit *u, const char *line) { if (type < 0) return log_error_errno(type, "Cannot parse \"%s\".", line); - const char *val = skip_leading_chars(eq + 1, /* bad= */ NULL); + const char *val = skip_leading_chars(eq + 1, /* bad = */ NULL); ConfigParserCallback callback; if (condition_takes_path(type)) @@ -49,16 +49,16 @@ static int parse_condition(Unit *u, const char *line) { else callback = config_parse_unit_condition_string; - return callback(/* unit= */ NULL, - /* filename= */ "(cmdline)", - /* line= */ 0, - /* section= */ NULL, - /* section_line= */ 0, - /* lvalue= */ type_string, - /* ltype= */ type, - /* rvalue= */ val, - /* data= */ target, - /* userdata= */ u); + return callback(/* unit = */ NULL, + /* filename = */ "(cmdline)", + /* line = */ 0, + /* section = */ NULL, + /* section_line = */ 0, + /* lvalue = */ type_string, + /* ltype = */ type, + /* rvalue = */ val, + /* data = */ target, + /* userdata = */ u); } _printf_(7, 8) @@ -72,10 +72,10 @@ static int log_helper(void *userdata, int level, int error, const char *file, in va_start(ap, format); r = log_object_internalv(level, error, file, line, func, - /* object_field= */ unit_log_field(u), - /* object= */ u->id, - /* extra_field= */ NULL, - /* extra= */ NULL, + /* object_field = */ unit_log_field(u), + /* object = */ u->id, + /* extra_field = */ NULL, + /* extra = */ NULL, format, ap); va_end(ap); diff --git a/src/analyze/analyze-critical-chain.c b/src/analyze/analyze-critical-chain.c index 887baf8d149..0d5cb003070 100644 --- a/src/analyze/analyze-critical-chain.c +++ b/src/analyze/analyze-critical-chain.c @@ -98,7 +98,7 @@ static int list_dependencies_one(sd_bus *bus, const char *name, unsigned level, typesafe_qsort(deps, strv_length(deps), list_dependencies_compare); - r = acquire_boot_times(bus, /* require_finished= */ true, &boot); + r = acquire_boot_times(bus, /* require_finished = */ true, &boot); if (r < 0) return r; @@ -183,7 +183,7 @@ static int list_dependencies(sd_bus *bus, const char *name) { times = hashmap_get(unit_times_hashmap, id); - r = acquire_boot_times(bus, /* require_finished= */ true, &boot); + r = acquire_boot_times(bus, /* require_finished = */ true, &boot); if (r < 0) return r; @@ -210,7 +210,7 @@ int verb_critical_chain(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_connect_error(r, arg_transport, arg_runtime_scope); - n = acquire_time_data(bus, /* require_finished= */ true, ×); + n = acquire_time_data(bus, /* require_finished = */ true, ×); if (n <= 0) return n; diff --git a/src/analyze/analyze-fdstore.c b/src/analyze/analyze-fdstore.c index 98c3d621463..1f121515d9d 100644 --- a/src/analyze/analyze-fdstore.c +++ b/src/analyze/analyze-fdstore.c @@ -93,7 +93,7 @@ static int dump_fdstore(sd_bus *bus, const char *arg) { if (table_isempty(table) && !sd_json_format_enabled(arg_json_format_flags)) log_info("No file descriptors in fdstore of '%s'.", unit); else { - r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */ true); + r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */true); if (r < 0) return r; } diff --git a/src/analyze/analyze-pcrs.c b/src/analyze/analyze-pcrs.c index 8c1d7f3cfc6..ab5ef0e4de2 100644 --- a/src/analyze/analyze-pcrs.c +++ b/src/analyze/analyze-pcrs.c @@ -53,7 +53,7 @@ static int get_current_pcr(const char *alg, uint32_t pcr, void **ret, size_t *re if (r < 0) return log_error_errno(r, "Failed to read '%s': %m", p); - r = unhexmem_full(s, ss, /* secure= */ false, &buf, &bufsize); + r = unhexmem_full(s, ss, /* secure = */ false, &buf, &bufsize); if (r < 0) return log_error_errno(r, "Failed to decode hex PCR data '%s': %m", s); @@ -141,7 +141,7 @@ int verb_pcrs(int argc, char *argv[], void *userdata) { return r; } - r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */ true); + r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */true); if (r < 0) return r; diff --git a/src/analyze/analyze-plot.c b/src/analyze/analyze-plot.c index 21a9aa9f1cf..060d1078f24 100644 --- a/src/analyze/analyze-plot.c +++ b/src/analyze/analyze-plot.c @@ -483,7 +483,7 @@ int verb_plot(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_connect_error(r, arg_transport, arg_runtime_scope); - n = acquire_boot_times(bus, /* require_finished= */ true, &boot); + n = acquire_boot_times(bus, /* require_finished = */ true, &boot); if (n < 0) return n; @@ -497,7 +497,7 @@ int verb_plot(int argc, char *argv[], void *userdata) { return n; } - n = acquire_time_data(bus, /* require_finished= */ true, ×); + n = acquire_time_data(bus, /* require_finished = */ true, ×); if (n <= 0) return n; diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index 142262cb554..d5adcf7cabc 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -1884,7 +1884,7 @@ static int assess(const SecurityInfo *info, return log_error_errno(r, "Failed to set columns to display: %m"); } - r = table_print_with_pager(details_table, json_format_flags, pager_flags, /* show_header= */ true); + r = table_print_with_pager(details_table, json_format_flags, pager_flags, /* show_header= */true); if (r < 0) return r; } @@ -2897,7 +2897,7 @@ static int analyze_security(sd_bus *bus, fflush(stdout); } - r = table_print_with_pager(overview_table, json_format_flags, pager_flags, /* show_header= */ true); + r = table_print_with_pager(overview_table, json_format_flags, pager_flags, /* show_header= */true); if (r < 0) return r; } @@ -2919,19 +2919,19 @@ int verb_security(int argc, char *argv[], void *userdata) { unsigned line = 0, column = 0; if (arg_security_policy) { - r = sd_json_parse_file(/* f= */ NULL, arg_security_policy, /* flags= */ 0, &policy, &line, &column); + r = sd_json_parse_file(/*f=*/ NULL, arg_security_policy, /*flags=*/ 0, &policy, &line, &column); if (r < 0) return log_error_errno(r, "Failed to parse '%s' at %u:%u: %m", arg_security_policy, line, column); } else { _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *pp = NULL; - r = search_and_fopen_nulstr("systemd-analyze-security.policy", "re", /* root= */ NULL, CONF_PATHS_NULSTR("systemd"), &f, &pp); + r = search_and_fopen_nulstr("systemd-analyze-security.policy", "re", /*root=*/ NULL, CONF_PATHS_NULSTR("systemd"), &f, &pp); if (r < 0 && r != -ENOENT) return r; if (f) { - r = sd_json_parse_file(f, pp, /* flags= */ 0, &policy, &line, &column); + r = sd_json_parse_file(f, pp, /*flags=*/ 0, &policy, &line, &column); if (r < 0) return log_error_errno(r, "[%s:%u:%u] Failed to parse JSON policy: %m", pp, line, column); } @@ -2950,5 +2950,5 @@ int verb_security(int argc, char *argv[], void *userdata) { arg_profile, arg_json_format_flags, arg_pager_flags, - /* flags= */ 0); + /*flags=*/ 0); } diff --git a/src/analyze/analyze-time-data.c b/src/analyze/analyze-time-data.c index 9b67a1b417c..93f1bd399e7 100644 --- a/src/analyze/analyze-time-data.c +++ b/src/analyze/analyze-time-data.c @@ -172,7 +172,7 @@ int pretty_boot_time(sd_bus *bus, char **ret) { BootTimes *t; int r; - r = acquire_boot_times(bus, /* require_finished= */ true, &t); + r = acquire_boot_times(bus, /* require_finished = */ true, &t); if (r < 0) return r; diff --git a/src/analyze/analyze-unit-gdb.c b/src/analyze/analyze-unit-gdb.c index 1d989462cf1..4fe108f89b5 100644 --- a/src/analyze/analyze-unit-gdb.c +++ b/src/analyze/analyze-unit-gdb.c @@ -105,7 +105,7 @@ int verb_unit_gdb(int argc, char *argv[], void *userdata) { } else assert_not_reached(); - r = strv_extend_strv(&debugger_call, arg_debugger_args, /* filter_duplicates= */ false); + r = strv_extend_strv(&debugger_call, arg_debugger_args, /* filter_duplicates = */ false); if (r < 0) return log_oom(); diff --git a/src/analyze/analyze-verify-util.c b/src/analyze/analyze-verify-util.c index dfa1cf7b3bc..40952531d75 100644 --- a/src/analyze/analyze-verify-util.c +++ b/src/analyze/analyze-verify-util.c @@ -256,7 +256,7 @@ static int verify_unit(Unit *u, bool check_man, const char *root) { unit_dump(u, stdout, "\t"); log_unit_debug(u, "Creating %s/start job", u->id); - r = manager_add_job(u->manager, JOB_START, u, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_START, u, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) log_unit_error_errno(u, r, "Failed to create %s/start: %s", u->id, bus_error_message(&error, r)); diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c index 86994412dcf..ee0ae82a50a 100644 --- a/src/backlight/backlight.c +++ b/src/backlight/backlight.c @@ -58,12 +58,12 @@ static int has_multiple_graphics_cards(void) { if (r < 0) return r; - r = sd_device_enumerator_add_match_subsystem(e, "pci", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "pci", /* match = */ true); if (r < 0) return r; /* class is an unsigned number, let's validate the value later. */ - r = sd_device_enumerator_add_match_sysattr(e, "class", NULL, /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(e, "class", NULL, /* match = */ true); if (r < 0) return r; @@ -233,7 +233,7 @@ static int validate_device(sd_device *device) { if (r < 0) return log_debug_errno(r, "Failed to allow uninitialized devices: %m"); - r = sd_device_enumerator_add_match_subsystem(enumerate, "backlight", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(enumerate, "backlight", /* match = */ true); if (r < 0) return log_debug_errno(r, "Failed to add subsystem match: %m"); @@ -241,11 +241,11 @@ static int validate_device(sd_device *device) { if (r < 0) return log_debug_errno(r, "Failed to add sysname unmatch: %m"); - r = sd_device_enumerator_add_match_sysattr(enumerate, "type", "platform", /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(enumerate, "type", "platform", /* match = */ true); if (r < 0) return log_debug_errno(r, "Failed to add sysattr match: %m"); - r = sd_device_enumerator_add_match_sysattr(enumerate, "type", "firmware", /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(enumerate, "type", "firmware", /* match = */ true); if (r < 0) return log_debug_errno(r, "Failed to add sysattr match: %m"); @@ -591,9 +591,9 @@ static int verb_load(int argc, char *argv[], void *userdata) { if (r < 0) return log_device_error_errno(device, r, "Failed to read current brightness: %m"); - (void) clamp_brightness(device, percent, /* saved= */ false, max_brightness, &brightness); + (void) clamp_brightness(device, percent, /* saved = */ false, max_brightness, &brightness); } else if (clamp) - (void) clamp_brightness(device, percent, /* saved= */ true, max_brightness, &brightness); + (void) clamp_brightness(device, percent, /* saved = */ true, max_brightness, &brightness); r = sd_device_set_sysattr_valuef(device, "brightness", "%u", brightness); if (r < 0) diff --git a/src/basic/build-path.c b/src/basic/build-path.c index ddbaf4ee3c6..32120893792 100644 --- a/src/basic/build-path.c +++ b/src/basic/build-path.c @@ -264,7 +264,7 @@ int pin_callout_binary(const char *path, char **ret_path) { const char *e; if (find_environment_binary(fn, &e) >= 0) { /* The environment variable counts. We'd fail if the executable is not available/invalid. */ - r = open_and_check_executable(e, /* root= */ NULL, ret_path, &fd); + r = open_and_check_executable(e, /* root = */ NULL, ret_path, &fd); if (r < 0) return r; @@ -273,13 +273,13 @@ int pin_callout_binary(const char *path, char **ret_path) { _cleanup_free_ char *np = NULL; if (find_build_dir_binary(fn, &np) >= 0) { - r = open_and_check_executable(np, /* root= */ NULL, ret_path, &fd); + r = open_and_check_executable(np, /* root = */ NULL, ret_path, &fd); if (r >= 0) return fd; } - r = find_executable_full(path, /* root= */ NULL, - /* exec_search_path= */ NULL, /* use_path_envvar= */ true, + r = find_executable_full(path, /* root = */ NULL, + /* exec_search_path = */ NULL, /* use_path_envvar = */ true, ret_path, &fd); if (r < 0) return r; diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index e5da9118dd8..efecde977cd 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -241,7 +241,7 @@ int cg_enumerate_subgroups(const char *path, DIR **ret) { /* This is not recursive! */ - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -479,7 +479,7 @@ int cg_set_xattr(const char *path, const char *name, const void *value, size_t s assert(name); assert(value || size <= 0); - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -493,7 +493,7 @@ int cg_get_xattr(const char *path, const char *name, char **ret, size_t *ret_siz assert(path); assert(name); - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -507,7 +507,7 @@ int cg_get_xattr_bool(const char *path, const char *name) { assert(path); assert(name); - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -521,7 +521,7 @@ int cg_remove_xattr(const char *path, const char *name) { assert(path); assert(name); - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -1193,7 +1193,7 @@ int cg_path_get_slice(const char *p, char **ret_slice) { const char *s; int n; - n = path_find_first_component(&p, /* accept_dot_dot= */ false, &s); + n = path_find_first_component(&p, /* accept_dot_dot = */ false, &s); if (n < 0) return n; if (!valid_slice_name(s, n)) @@ -1487,7 +1487,7 @@ int cg_get_owner(const char *path, uid_t *ret_uid) { assert(ret_uid); - r = cg_get_path(path, /* suffix= */ NULL, &f); + r = cg_get_path(path, /* suffix = */ NULL, &f); if (r < 0) return r; @@ -1525,7 +1525,7 @@ int cg_get_keyed_attribute( if (r < 0) return r; - r = read_full_file(filename, &contents, /* ret_size= */ NULL); + r = read_full_file(filename, &contents, /* ret_size = */ NULL); if (r < 0) return r; diff --git a/src/basic/chase.c b/src/basic/chase.c index 0199f5dd69d..a90ae41d994 100644 --- a/src/basic/chase.c +++ b/src/basic/chase.c @@ -403,7 +403,7 @@ int chaseat(int dir_fd, const char *path, ChaseFlags flags, char **ret_path, int } /* Otherwise let's pin it by file descriptor, via O_PATH. */ - child = r = openat_opath_with_automount(fd, first, /* automount= */ FLAGS_SET(flags, CHASE_TRIGGER_AUTOFS)); + child = r = openat_opath_with_automount(fd, first, /* automount = */ FLAGS_SET(flags, CHASE_TRIGGER_AUTOFS)); if (r < 0) { if (r != -ENOENT) return r; diff --git a/src/basic/chattr-util.c b/src/basic/chattr-util.c index 26779305cbb..9a4e97327e0 100644 --- a/src/basic/chattr-util.c +++ b/src/basic/chattr-util.c @@ -241,9 +241,9 @@ static int set_proj_id_cb( int set_proj_id_recursive(int fd, uint32_t proj_id) { return recurse_dir_at( fd, - /* path= */ NULL, - /* statx_mask= */ 0, - /* n_depth_max= */ UINT_MAX, + /* path = */ NULL, + /* statx_mask = */ 0, + /* n_depth_max = */ UINT_MAX, RECURSE_DIR_ENSURE_TYPE|RECURSE_DIR_TOPLEVEL|RECURSE_DIR_INODE_FD, set_proj_id_cb, UINT32_TO_PTR(proj_id)); diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index ea41c4da4a2..7e1ff4f90b0 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -148,7 +148,7 @@ int conf_file_new_at(const char *path, int rfd, ChaseFlags chase_flags, ConfFile CHASE_AT_RESOLVE_IN_ROOT | CHASE_MUST_BE_DIRECTORY | (FLAGS_SET(chase_flags, CHASE_NONEXISTENT) ? CHASE_NONEXISTENT : 0), - &resolved_dirpath, /* ret_fd= */ NULL); + &resolved_dirpath, /* ret_fd = */ NULL); if (r < 0) return log_debug_errno(r, "Failed to chase '%s%s': %m", empty_to_root(root), skip_leading_slash(dirpath)); } @@ -177,7 +177,7 @@ int conf_file_new(const char *path, const char *root, ChaseFlags chase_flags, Co _cleanup_free_ char *root_abs = NULL; _cleanup_close_ int rfd = -EBADF; - r = prepare_dirs(root, /* dirs= */ NULL, &rfd, &root_abs, /* ret_dirs= */ NULL); + r = prepare_dirs(root, /* dirs = */ NULL, &rfd, &root_abs, /* ret_dirs = */ NULL); if (r < 0) return r; @@ -593,7 +593,7 @@ int conf_files_list_strv( return r; r = conf_files_list_impl(suffix, rfd, root_abs, flags, (const char * const *) dirs_abs, - /* replacement= */ NULL, &fh, /* ret_inserted= */ NULL); + /* replacement = */ NULL, &fh, /* ret_inserted = */ NULL); if (r < 0) return r; @@ -622,7 +622,7 @@ int conf_files_list_strv_full( return r; r = conf_files_list_impl(suffix, rfd, root_abs, flags, (const char * const *) dirs_abs, - /* replacement= */ NULL, &fh, /* ret_inserted= */ NULL); + /* replacement = */ NULL, &fh, /* ret_inserted = */ NULL); if (r < 0) return r; @@ -646,11 +646,11 @@ int conf_files_list_strv_at( if (rfd >= 0 && DEBUG_LOGGING) (void) fd_get_path(rfd, &root); /* for logging */ - r = conf_files_list_impl(suffix, rfd, root, flags, dirs, /* replacement= */ NULL, &fh, /* ret_inserted= */ NULL); + r = conf_files_list_impl(suffix, rfd, root, flags, dirs, /* replacement = */ NULL, &fh, /* ret_inserted = */ NULL); if (r < 0) return r; - return copy_and_sort_files_from_hashmap(fh, suffix, /* root= */ NULL, flags, ret); + return copy_and_sort_files_from_hashmap(fh, suffix, /* root = */ NULL, flags, ret); } int conf_files_list_strv_at_full( @@ -672,11 +672,11 @@ int conf_files_list_strv_at_full( if (rfd >= 0 && DEBUG_LOGGING) (void) fd_get_path(rfd, &root); /* for logging */ - r = conf_files_list_impl(suffix, rfd, root, flags, dirs, /* replacement= */ NULL, &fh, /* ret_inserted= */ NULL); + r = conf_files_list_impl(suffix, rfd, root, flags, dirs, /* replacement = */ NULL, &fh, /* ret_inserted = */ NULL); if (r < 0) return r; - return dump_files(fh, /* root= */ NULL, ret_files, ret_n_files); + return dump_files(fh, /* root = */ NULL, ret_files, ret_n_files); } int conf_files_list(char ***ret, const char *suffix, const char *root, ConfFilesFlags flags, const char *dir) { diff --git a/src/basic/efivars.c b/src/basic/efivars.c index a655382af84..df853935ca1 100644 --- a/src/basic/efivars.c +++ b/src/basic/efivars.c @@ -248,11 +248,11 @@ int efi_set_variable(const char *variable, const void *value, size_t size) { * accidentally however, hence let's unset the bit first. */ r = chattr_full(AT_FDCWD, p, - /* value= */ 0, - /* mask= */ FS_IMMUTABLE_FL, - /* ret_previous= */ &saved_flags, - /* ret_final= */ NULL, - /* flags= */ 0); + /* value = */ 0, + /* mask = */ FS_IMMUTABLE_FL, + /* ret_previous = */ &saved_flags, + /* ret_final = */ NULL, + /* flags = */ 0); if (r < 0 && r != -ENOENT) log_debug_errno(r, "Failed to drop FS_IMMUTABLE_FL flag from '%s', ignoring: %m", p); @@ -288,7 +288,7 @@ int efi_set_variable(const char *variable, const void *value, size_t size) { /* For some reason efivarfs doesn't update mtime automatically. Let's do it manually then. This is * useful for processes that cache EFI variables to detect when changes occurred. */ - if (futimens(fd, /* times= */ NULL) < 0) + if (futimens(fd, /* times = */ NULL) < 0) log_debug_errno(errno, "Failed to update mtime/atime on %s, ignoring: %m", p); r = 0; diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 90436f6ecf8..2e6fffbd850 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -881,7 +881,7 @@ int script_get_shebang_interpreter(const char *path, char **ret) { _cleanup_free_ char *p = NULL; const char *s = line; - r = extract_first_word(&s, &p, /* separators= */ NULL, /* flags= */ 0); + r = extract_first_word(&s, &p, /* separators = */ NULL, /* flags = */ 0); if (r < 0) return r; if (r == 0) diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index d668416ff8c..6284bb2ddcc 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -329,7 +329,7 @@ int futimens_opath(int fd, const struct timespec ts[2]) { /* Support for AT_EMPTY_PATH is added rather late (kernel 5.8), so fall back to going through /proc/ * if unavailable. */ - if (utimensat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), ts, /* flags= */ 0) < 0) { + if (utimensat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), ts, /* flags = */ 0) < 0) { if (errno != ENOENT) return -errno; @@ -649,7 +649,7 @@ static int tmp_dir_internal(const char *def, const char **ret) { return 0; } - k = is_dir(def, /* follow= */ true); + k = is_dir(def, /* follow = */ true); if (k == 0) k = -ENOTDIR; if (k < 0) diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c index a2b2edd2108..eda7bcb6c51 100644 --- a/src/basic/glob-util.c +++ b/src/basic/glob-util.c @@ -158,7 +158,7 @@ int glob_extend(char ***strv, const char *path, int flags) { if (r < 0) return r; - return strv_extend_strv_consume(strv, v, /* filter_duplicates= */ false); + return strv_extend_strv_consume(strv, v, /* filter_duplicates = */ false); } int glob_non_glob_prefix(const char *path, char **ret) { diff --git a/src/basic/lock-util.c b/src/basic/lock-util.c index 4f0bc8b50cb..83ada416fd0 100644 --- a/src/basic/lock-util.c +++ b/src/basic/lock-util.c @@ -44,7 +44,7 @@ int make_lock_file_at(int dir_fd, const char *p, int operation, LockFile *ret) { fd = xopenat_lock_full(dfd, p, O_CREAT|O_RDWR|O_NOFOLLOW|O_CLOEXEC|O_NOCTTY, - /* xopen_flags= */ 0, + /* xopen_flags = */ 0, 0600, LOCK_UNPOSIX, operation); @@ -154,11 +154,11 @@ static int fcntl_lock(int fd, int operation, bool ofd) { } int posix_lock(int fd, int operation) { - return fcntl_lock(fd, operation, /* ofd= */ false); + return fcntl_lock(fd, operation, /*ofd=*/ false); } int unposix_lock(int fd, int operation) { - return fcntl_lock(fd, operation, /* ofd= */ true); + return fcntl_lock(fd, operation, /*ofd=*/ true); } void posix_unlockpp(int **fd) { @@ -167,7 +167,7 @@ void posix_unlockpp(int **fd) { if (!*fd || **fd < 0) return; - (void) fcntl_lock(**fd, LOCK_UN, /* ofd= */ false); + (void) fcntl_lock(**fd, LOCK_UN, /*ofd=*/ false); *fd = NULL; } @@ -177,7 +177,7 @@ void unposix_unlockpp(int **fd) { if (!*fd || **fd < 0) return; - (void) fcntl_lock(**fd, LOCK_UN, /* ofd= */ true); + (void) fcntl_lock(**fd, LOCK_UN, /*ofd=*/ true); *fd = NULL; } diff --git a/src/basic/log-context.c b/src/basic/log-context.c index a05b4b1980e..334fe95fc34 100644 --- a/src/basic/log-context.c +++ b/src/basic/log-context.c @@ -145,7 +145,7 @@ static LogContext* log_context_free(LogContext *c) { DEFINE_TRIVIAL_REF_UNREF_FUNC(LogContext, log_context, log_context_free); LogContext* log_context_new_strv_consume(char **fields) { - LogContext *c = log_context_new_strv(fields, /* owned= */ true); + LogContext *c = log_context_new_strv(fields, /*owned=*/ true); if (!c) strv_free(fields); @@ -153,7 +153,7 @@ LogContext* log_context_new_strv_consume(char **fields) { } LogContext* log_context_new_iov_consume(struct iovec *input_iovec, size_t n_input_iovec) { - LogContext *c = log_context_new_iov(input_iovec, n_input_iovec, /* owned= */ true); + LogContext *c = log_context_new_iov(input_iovec, n_input_iovec, /*owned=*/ true); if (!c) iovec_array_free(input_iovec, n_input_iovec); diff --git a/src/basic/log-context.h b/src/basic/log-context.h index 009abe3bb17..52998707bbd 100644 --- a/src/basic/log-context.h +++ b/src/basic/log-context.h @@ -90,13 +90,13 @@ void _reset_log_level(int *saved_log_level); _LOG_CONTEXT_PUSH_KEY_VALUE(key, value, UNIQ_T(c, UNIQ)) #define _LOG_CONTEXT_PUSH_STRV(strv, c) \ - _unused_ _cleanup_(log_context_unrefp) LogContext *c = log_context_new_strv(strv, /* owned= */ false); + _unused_ _cleanup_(log_context_unrefp) LogContext *c = log_context_new_strv(strv, /*owned=*/ false); #define LOG_CONTEXT_PUSH_STRV(strv) \ _LOG_CONTEXT_PUSH_STRV(strv, UNIQ_T(c, UNIQ)) #define _LOG_CONTEXT_PUSH_IOV(input_iovec, n_input_iovec, c) \ - _unused_ _cleanup_(log_context_unrefp) LogContext *c = log_context_new_iov(input_iovec, n_input_iovec, /* owned= */ false); + _unused_ _cleanup_(log_context_unrefp) LogContext *c = log_context_new_iov(input_iovec, n_input_iovec, /*owned=*/ false); #define LOG_CONTEXT_PUSH_IOV(input_iovec, n_input_iovec) \ _LOG_CONTEXT_PUSH_IOV(input_iovec, n_input_iovec, UNIQ_T(c, UNIQ)) diff --git a/src/basic/log.h b/src/basic/log.h index 616cb8b9291..6bd0c2dec07 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -374,7 +374,7 @@ int log_syntax_parse_error_internal( log_syntax_parse_error_internal(unit, config_file, config_line, error, critical, PROJECT_FILE, __LINE__, __func__, lvalue, rvalue) #define log_syntax_parse_error(unit, config_file, config_line, error, lvalue, rvalue) \ - log_syntax_parse_error_full(unit, config_file, config_line, error, /* critical= */ false, lvalue, rvalue) + log_syntax_parse_error_full(unit, config_file, config_line, error, /* critical = */ false, lvalue, rvalue) #define DEBUG_LOGGING _unlikely_(log_get_max_level() >= LOG_DEBUG) diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c index f670840e3ce..5f1ecad5625 100644 --- a/src/basic/mkdir.c +++ b/src/basic/mkdir.c @@ -113,7 +113,7 @@ int mkdirat_parents_internal(int dir_fd, const char *path, mode_t mode, uid_t ui /* drop the last component */ path = strndupa_safe(path, e - path); - r = is_dir_at(dir_fd, path, /* follow= */ true); + r = is_dir_at(dir_fd, path, /* follow = */ true); if (r > 0) return 0; if (r == 0) diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 1b231ec6377..7d11467a23b 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -1465,11 +1465,11 @@ int path_glob_can_match(const char *pattern, const char *prefix, char **ret) { const char *p, *q; int r, s; - r = path_find_first_component(&a, /* accept_dot_dot= */ false, &p); + r = path_find_first_component(&a, /* accept_dot_dot = */ false, &p); if (r < 0) return r; - s = path_find_first_component(&b, /* accept_dot_dot= */ false, &q); + s = path_find_first_component(&b, /* accept_dot_dot = */ false, &q); if (s < 0) return s; diff --git a/src/basic/pidfd-util.c b/src/basic/pidfd-util.c index d1ae1c5893d..4b4caf5c9c9 100644 --- a/src/basic/pidfd-util.c +++ b/src/basic/pidfd-util.c @@ -29,7 +29,7 @@ int pidfd_check_pidfs(int pid_fd) { _cleanup_close_ int our_fd = -EBADF; if (pid_fd < 0) { - our_fd = pidfd_open(getpid_cached(), /* flags= */ 0); + our_fd = pidfd_open(getpid_cached(), /* flags = */ 0); if (our_fd < 0) return -errno; diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c index eb61b0bc554..e5a8928cc90 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -62,7 +62,7 @@ int proc_cmdline_filter_pid1_args(char **argv, char ***ret) { if (a[1] == '-') { if (a[2] == '\0') { /* "--" is specified, accepting remaining strings. */ - r = strv_extend_strv(&filtered, strv_skip(p, 1), /* filter_duplicates= */ false); + r = strv_extend_strv(&filtered, strv_skip(p, 1), /* filter_duplicates = */ false); if (r < 0) return r; break; @@ -137,7 +137,7 @@ static int proc_cmdline_strv_internal(char ***ret, bool filter_pid1_args) { if (detect_container() > 0) { _cleanup_strv_free_ char **args = NULL; - r = pid_get_cmdline_strv(1, /* flags= */ 0, &args); + r = pid_get_cmdline_strv(1, /* flags = */ 0, &args); if (r < 0) return r; @@ -159,7 +159,7 @@ static int proc_cmdline_strv_internal(char ***ret, bool filter_pid1_args) { } int proc_cmdline_strv(char ***ret) { - return proc_cmdline_strv_internal(ret, /* filter_pid1_args= */ false); + return proc_cmdline_strv_internal(ret, /* filter_pid1_args = */ false); } static char *mangle_word(const char *word, ProcCmdlineFlags flags) { @@ -216,7 +216,7 @@ int proc_cmdline_parse(proc_cmdline_parse_t parse_item, void *data, ProcCmdlineF * for proc_cmdline_parse(), let's make this clear. */ assert(!(flags & (PROC_CMDLINE_VALUE_OPTIONAL|PROC_CMDLINE_TRUE_WHEN_MISSING))); - r = proc_cmdline_strv_internal(&args, /* filter_pid1_args= */ true); + r = proc_cmdline_strv_internal(&args, /* filter_pid1_args = */ true); if (r < 0) return r; @@ -326,7 +326,7 @@ int proc_cmdline_get_key(const char *key, ProcCmdlineFlags flags, char **ret_val if (FLAGS_SET(flags, PROC_CMDLINE_VALUE_OPTIONAL) && !ret_value) return -EINVAL; - r = proc_cmdline_strv_internal(&args, /* filter_pid1_args= */ true); + r = proc_cmdline_strv_internal(&args, /* filter_pid1_args = */ true); if (r < 0) return r; diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 31dbdff87a2..b14d4fd5e94 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -249,7 +249,7 @@ int pid_get_cmdline(pid_t pid, size_t max_columns, ProcessCmdlineFlags flags, ch /* Drop trailing NULs, otherwise strv_parse_nulstr() adds additional empty strings at the end. * See also issue #21186. */ - args = strv_parse_nulstr_full(t, k, /* drop_trailing_nuls= */ true); + args = strv_parse_nulstr_full(t, k, /* drop_trailing_nuls = */ true); if (!args) return -ENOMEM; @@ -315,7 +315,7 @@ int pid_get_cmdline_strv(pid_t pid, ProcessCmdlineFlags flags, char ***ret) { if (r < 0) return r; - args = strv_parse_nulstr_full(t, k, /* drop_trailing_nuls= */ true); + args = strv_parse_nulstr_full(t, k, /* drop_trailing_nuls = */ true); if (!args) return -ENOMEM; @@ -2341,7 +2341,7 @@ int read_errno(int errno_fd) { /* The issue here is that it's impossible to distinguish between an error code returned by child and * IO error arose when reading it. So, the function logs errors and return EIO for the later case. */ - ssize_t n = loop_read(errno_fd, &r, sizeof(r), /* do_poll= */ false); + ssize_t n = loop_read(errno_fd, &r, sizeof(r), /* do_poll = */ false); if (n < 0) { log_debug_errno(n, "Failed to read errno: %m"); return -EIO; diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c index eaa36e39210..47f460e4f1b 100644 --- a/src/basic/procfs-util.c +++ b/src/basic/procfs-util.c @@ -183,7 +183,7 @@ int convert_meminfo_value_to_uint64_bytes(const char *s, uint64_t *ret) { assert(s); assert(ret); - r = extract_first_word(&s, &w, /* separators= */ NULL, /* flags= */ 0); + r = extract_first_word(&s, &w, /* separators = */ NULL, /* flags = */ 0); if (r < 0) return r; if (r == 0) diff --git a/src/basic/ratelimit.h b/src/basic/ratelimit.h index 4d6c7f6e523..ecc1b9dd1f5 100644 --- a/src/basic/ratelimit.h +++ b/src/basic/ratelimit.h @@ -5,7 +5,7 @@ typedef struct RateLimit { usec_t interval; /* Keep those two fields first so they can be initialized easily: */ - unsigned burst; /* RateLimit rl = { INTERVAL, BURST }; */ + unsigned burst; /* RateLimit rl = { INTERVAL, BURST }; */ unsigned num; usec_t begin; } RateLimit; diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c index 9eef4e1d8c4..2f63aa48f93 100644 --- a/src/basic/recurse-dir.c +++ b/src/basic/recurse-dir.c @@ -230,9 +230,9 @@ int recurse_dir( r = func(RECURSE_DIR_SKIP_OPEN_DIR_ERROR_BASE + errno, p, dir_fd, - /* inode_fd= */ -EBADF, + /* inode_fd = */ -EBADF, i, - /* sx= */ NULL, + /* sx = */ NULL, userdata); if (r == RECURSE_DIR_LEAVE_DIRECTORY) break; @@ -274,9 +274,9 @@ int recurse_dir( r = func(RECURSE_DIR_SKIP_OPEN_INODE_ERROR_BASE + errno, p, dir_fd, - /* inode_fd= */ -EBADF, + /* inode_fd = */ -EBADF, i, - /* sx= */ NULL, + /* sx = */ NULL, userdata); if (r == RECURSE_DIR_LEAVE_DIRECTORY) break; @@ -322,9 +322,9 @@ int recurse_dir( r = func(RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE + errno, p, dir_fd, - /* inode_fd= */ -EBADF, + /* inode_fd = */ -EBADF, i, - /* sx= */ NULL, + /* sx = */ NULL, userdata); if (r == RECURSE_DIR_LEAVE_DIRECTORY) break; @@ -352,9 +352,9 @@ int recurse_dir( r = func(RECURSE_DIR_SKIP_STAT_INODE_ERROR_BASE + EISDIR, p, dir_fd, - /* inode_fd= */ -EBADF, + /* inode_fd = */ -EBADF, i, - /* sx= */ NULL, + /* sx = */ NULL, userdata); if (r == RECURSE_DIR_LEAVE_DIRECTORY) break; @@ -384,7 +384,7 @@ int recurse_dir( if (sx_valid && FLAGS_SET(sx.stx_attributes_mask, STATX_ATTR_MOUNT_ROOT)) is_mount = FLAGS_SET(sx.stx_attributes, STATX_ATTR_MOUNT_ROOT); else { - r = is_mount_point_at(dir_fd, i->d_name, /* flags= */ 0); + r = is_mount_point_at(dir_fd, i->d_name, /* flags = */ 0); if (r < 0) log_debug_errno(r, "Failed to determine whether %s is a submount, assuming not: %m", p); diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c index 331f2d1a5b6..8a26feb03da 100644 --- a/src/basic/rlimit-util.c +++ b/src/basic/rlimit-util.c @@ -464,7 +464,7 @@ int pid_getrlimit(pid_t pid, int resource, struct rlimit *ret) { const char *p = procfs_file_alloca(pid, "limits"); _cleanup_free_ char *limits = NULL; - r = read_full_file(p, &limits, /* ret_size= */ NULL); + r = read_full_file(p, &limits, /* ret_size = */ NULL); if (r < 0) return -EPERM; /* propagate original permission error if we can't access the limits file */ diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 9f62b114278..27635ad899c 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -1320,7 +1320,7 @@ ssize_t flush_mqueue(int fd) { return -ENOMEM; } - l = mq_receive(fd, buf, attr.mq_msgsize, /* msg_prio= */ NULL); + l = mq_receive(fd, buf, attr.mq_msgsize, /* msg_prio = */ NULL); if (l < 0) { if (errno == EINTR) continue; diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 0c5c0a62872..cbdc8c3e968 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -332,7 +332,7 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le x = ((new_length - need_space) * percent + 50) / 100; assert(x <= new_length - need_space); - write_ellipsis(mempcpy(t, s, x), /* unicode= */ false); + write_ellipsis(mempcpy(t, s, x), /* unicode = */ false); suffix_len = new_length - x - need_space; memcpy(t + x + 3, s + old_length - suffix_len, suffix_len); *(t + x + 3 + suffix_len) = '\0'; @@ -454,7 +454,7 @@ char* ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne return NULL; memcpy_safe(e, s, len); - write_ellipsis(e + len, /* unicode= */ true); + write_ellipsis(e + len, /* unicode = */ true); char *dst = e + len + 3; @@ -533,7 +533,7 @@ char* cellescape(char *buf, size_t len, const char *s) { } if (i + 4 <= len) /* yay, enough space */ - i += write_ellipsis(buf + i, /* unicode= */ false); + i += write_ellipsis(buf + i, /* unicode = */ false); else if (i + 3 <= len) { /* only space for ".." */ buf[i++] = '.'; buf[i++] = '.'; diff --git a/src/basic/strv.c b/src/basic/strv.c index d930770f9e0..34d1e96b632 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -925,7 +925,7 @@ int strv_extend_joined_with_size_sentinel(char ***l, size_t *n, ...) { va_list ap; va_start(ap, n); - char *x = strextendv_with_separator(/* x= */ NULL, /* separator= */ NULL, ap); + char *x = strextendv_with_separator(/* x= */ NULL, /* separator=*/ NULL, ap); va_end(ap); if (!x) return -ENOMEM; diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 5749b585468..5609715b8a8 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -377,7 +377,7 @@ int ask_string_full( /* n_columns= */ SIZE_MAX, /* column_width= */ SIZE_MAX, /* ellipsize_percentage= */ 0, - /* grey_prefix= */ string, + /* grey_prefix=*/ string, /* with_numbers= */ false); if (r < 0) goto fail; @@ -730,7 +730,7 @@ int acquire_terminal( .fd = notify, .events = POLLIN, }, - /* n_fds= */ 1, + /* n_fds = */ 1, left, &poll_ss); if (r < 0) @@ -1095,7 +1095,7 @@ bool tty_is_vc(const char *tty) { * about whether it's strictly valid, but only asking "does this fall into the vt category?", for which * "yes" seems to be a better answer. */ - return vtnr_from_tty_raw(tty, /* ret= */ NULL) >= 0; + return vtnr_from_tty_raw(tty, /* ret = */ NULL) >= 0; } bool tty_is_console(const char *tty) { @@ -1387,7 +1387,7 @@ int proc_cmdline_tty_size(const char *tty, unsigned *ret_rows, unsigned *ret_col if (!colskey) return -ENOMEM; - r = proc_cmdline_get_key_many(/* flags= */ 0, + r = proc_cmdline_get_key_many(/* flags = */ 0, rowskey, &rowsvalue, colskey, &colsvalue); if (r < 0) @@ -1655,7 +1655,7 @@ int openpt_allocate_in_namespace( _cleanup_close_pair_ int pair[2] = EBADF_PAIR; int r; - r = pidref_namespace_open(pidref, &pidnsfd, &mntnsfd, /* ret_netns_fd= */ NULL, &usernsfd, &rootfd); + r = pidref_namespace_open(pidref, &pidnsfd, &mntnsfd, /* ret_netns_fd = */ NULL, &usernsfd, &rootfd); if (r < 0) return r; diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 8c776960e1b..51da7da2c52 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -1060,31 +1060,31 @@ int parse_timestamp(const char *t, usec_t *ret) { size_t t_len = strlen(t); if (t_len > 2 && t[t_len - 1] == 'Z') { /* Try to parse as RFC3339-style welded UTC: "1985-04-12T23:20:50.52Z" */ - r = parse_timestamp_impl(t, t_len - 1, /* utc= */ true, /* isdst= */ -1, /* gmtoff= */ 0, ret); + r = parse_timestamp_impl(t, t_len - 1, /* utc = */ true, /* isdst = */ -1, /* gmtoff = */ 0, ret); if (r >= 0) return r; } /* RFC3339-style welded offset: "1990-12-31T15:59:60-08:00" */ if (t_len > 7 && IN_SET(t[t_len - 6], '+', '-') && t[t_len - 7] != ' ' && parse_gmtoff(&t[t_len - 6], &gmtoff) >= 0) - return parse_timestamp_impl(t, t_len - 6, /* utc= */ true, /* isdst= */ -1, gmtoff, ret); + return parse_timestamp_impl(t, t_len - 6, /* utc = */ true, /* isdst = */ -1, gmtoff, ret); const char *tz = strrchr(t, ' '); if (!tz) - return parse_timestamp_impl(t, /* max_len= */ SIZE_MAX, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret); + return parse_timestamp_impl(t, /* max_len = */ SIZE_MAX, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret); size_t max_len = tz - t; tz++; /* Shortcut, parse the string as UTC. */ if (streq(tz, "UTC")) - return parse_timestamp_impl(t, max_len, /* utc= */ true, /* isdst= */ -1, /* gmtoff= */ 0, ret); + return parse_timestamp_impl(t, max_len, /* utc = */ true, /* isdst = */ -1, /* gmtoff = */ 0, ret); /* If the timezone is compatible with RFC-822/ISO 8601 (e.g. +06, or -03:00) then parse the string as * UTC and shift the result. Note, this must be earlier than the timezone check with tzname[], as * tzname[] may be in the same format. */ if (parse_gmtoff(tz, &gmtoff) >= 0) - return parse_timestamp_impl(t, max_len, /* utc= */ true, /* isdst= */ -1, gmtoff, ret); + return parse_timestamp_impl(t, max_len, /* utc = */ true, /* isdst = */ -1, gmtoff, ret); /* Check if the last word matches tzname[] of the local timezone. Note, this must be done earlier * than the check by timezone_is_valid() below, as some short timezone specifications have their own @@ -1096,7 +1096,7 @@ int parse_timestamp(const char *t, usec_t *ret) { continue; /* The specified timezone matches tzname[] of the local timezone. */ - return parse_timestamp_impl(t, max_len, /* utc= */ false, /* isdst= */ j, /* gmtoff= */ 0, ret); + return parse_timestamp_impl(t, max_len, /* utc = */ false, /* isdst = */ j, /* gmtoff = */ 0, ret); } /* If the last word is a valid timezone file (e.g. Asia/Tokyo), then save the current timezone, apply @@ -1104,15 +1104,15 @@ int parse_timestamp(const char *t, usec_t *ret) { if (timezone_is_valid(tz, LOG_DEBUG)) { SAVE_TIMEZONE; - if (setenv("TZ", tz, /* overwrite= */ true) < 0) + if (setenv("TZ", tz, /* overwrite = */ true) < 0) return negative_errno(); - return parse_timestamp_impl(t, max_len, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret); + return parse_timestamp_impl(t, max_len, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret); } /* Otherwise, assume that the last word is a part of the time and try to parse the whole string as a * local time. */ - return parse_timestamp_impl(t, SIZE_MAX, /* utc= */ false, /* isdst= */ -1, /* gmtoff= */ 0, ret); + return parse_timestamp_impl(t, SIZE_MAX, /* utc = */ false, /* isdst = */ -1, /* gmtoff = */ 0, ret); } static const char* extract_multiplier(const char *p, usec_t *ret) { @@ -1172,7 +1172,7 @@ int parse_time(const char *t, usec_t *ret, usec_t default_unit) { assert(t); assert(default_unit > 0); - p = skip_leading_chars(t, /* bad= */ NULL); + p = skip_leading_chars(t, /* bad = */ NULL); s = startswith(p, "infinity"); if (s) { if (!in_charset(s, WHITESPACE)) @@ -1190,7 +1190,7 @@ int parse_time(const char *t, usec_t *ret, usec_t default_unit) { long long l; char *e; - p = skip_leading_chars(p, /* bad= */ NULL); + p = skip_leading_chars(p, /* bad = */ NULL); if (*p == 0) { if (!something) return -EINVAL; @@ -1628,7 +1628,7 @@ int verify_timezone(const char *name, int log_level) { void reset_timezonep(char **p) { assert(p); - (void) set_unset_env("TZ", *p, /* overwrite= */ true); + (void) set_unset_env("TZ", *p, /* overwrite = */ true); tzset(); *p = mfree(*p); } diff --git a/src/basic/time-util.h b/src/basic/time-util.h index 13831fcd518..b5530e3e921 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -125,11 +125,11 @@ char* format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) _warn_unus _warn_unused_result_ static inline char* format_timestamp_relative(char *buf, size_t l, usec_t t) { - return format_timestamp_relative_full(buf, l, t, CLOCK_REALTIME, /* implicit_left= */ false); + return format_timestamp_relative_full(buf, l, t, CLOCK_REALTIME, /* implicit_left = */ false); } _warn_unused_result_ static inline char* format_timestamp_relative_monotonic(char *buf, size_t l, usec_t t) { - return format_timestamp_relative_full(buf, l, t, CLOCK_MONOTONIC, /* implicit_left= */ false); + return format_timestamp_relative_full(buf, l, t, CLOCK_MONOTONIC, /* implicit_left = */ false); } _warn_unused_result_ diff --git a/src/basic/tmpfile-util.c b/src/basic/tmpfile-util.c index bbfd4f58ab6..7eabc9c9007 100644 --- a/src/basic/tmpfile-util.c +++ b/src/basic/tmpfile-util.c @@ -202,7 +202,7 @@ int tempfn_xxxxxx(const char *p, const char *extra, char **ret) { * /foo/bar/.#waldoXXXXXX */ - return tempfn_build(p, extra, "XXXXXX", /* child= */ false, ret); + return tempfn_build(p, extra, "XXXXXX", /* child = */ false, ret); } int tempfn_random(const char *p, const char *extra, char **ret) { @@ -222,7 +222,7 @@ int tempfn_random(const char *p, const char *extra, char **ret) { if (asprintf(&s, "%016" PRIx64, random_u64()) < 0) return -ENOMEM; - return tempfn_build(p, extra, s, /* child= */ false, ret); + return tempfn_build(p, extra, s, /* child = */ false, ret); } int tempfn_random_child(const char *p, const char *extra, char **ret) { @@ -246,7 +246,7 @@ int tempfn_random_child(const char *p, const char *extra, char **ret) { if (asprintf(&s, "%016" PRIx64, random_u64()) < 0) return -ENOMEM; - return tempfn_build(p, extra, s, /* child= */ true, ret); + return tempfn_build(p, extra, s, /* child = */ true, ret); } int open_tmpfile_unlinkable(const char *directory, int flags) { diff --git a/src/basic/uid-range.c b/src/basic/uid-range.c index 0b87e789abe..2f20f0e1f10 100644 --- a/src/basic/uid-range.c +++ b/src/basic/uid-range.c @@ -125,7 +125,7 @@ int uid_range_add_str(UIDRange **range, const char *s) { if (r < 0) return r; - return uid_range_add_internal(range, start, end - start + 1, /* coalesce= */ true); + return uid_range_add_internal(range, start, end - start + 1, /* coalesce = */ true); } int uid_range_next_lower(const UIDRange *range, uid_t *uid) { @@ -274,7 +274,7 @@ int uid_range_load_userns(const char *path, UIDRangeUsernsMode mode, UIDRange ** &range, IN_SET(mode, UID_RANGE_USERNS_INSIDE, GID_RANGE_USERNS_INSIDE) ? uid_base : uid_shift, uid_range, - /* coalesce= */ false); + /* coalesce = */ false); if (r < 0) return r; } diff --git a/src/basic/virt.c b/src/basic/virt.c index 2eea145d9c0..707af529e0d 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -814,7 +814,7 @@ int running_in_chroot(void) { if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0) return 0; - r = inode_same("/proc/1/root", "/", /* flags= */ 0); + r = inode_same("/proc/1/root", "/", /* flags = */ 0); if (r == -ENOENT) { r = proc_mounted(); if (r == 0) { diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c index 2d0577979e2..cf53418ceb1 100644 --- a/src/basic/xattr-util.c +++ b/src/basic/xattr-util.c @@ -473,9 +473,9 @@ int fd_setcrtime(int fd, usec_t usec) { usec = now(CLOCK_REALTIME); le = htole64((uint64_t) usec); - return xsetxattr_full(fd, /* path= */ NULL, AT_EMPTY_PATH, + return xsetxattr_full(fd, /* path = */ NULL, AT_EMPTY_PATH, "user.crtime_usec", (const char*) &le, sizeof(le), - /* xattr_flags= */ 0); + /* xattr_flags = */ 0); } bool xattr_is_acl(const char *name) { diff --git a/src/battery-check/battery-check.c b/src/battery-check/battery-check.c index 43ff0e53e03..ef4038905e3 100644 --- a/src/battery-check/battery-check.c +++ b/src/battery-check/battery-check.c @@ -147,10 +147,10 @@ static int run(int argc, char *argv[]) { log_warning_errno(fd, "Failed to open console, ignoring: %m"); else dprintf(fd, ANSI_HIGHLIGHT_RED "%s " BATTERY_LOW_MESSAGE ANSI_NORMAL "\n", - glyph_full(GLYPH_LOW_BATTERY, /* force_utf= */ false)); + glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ false)); if (asprintf(&plymouth_message, "%s " BATTERY_LOW_MESSAGE, - glyph_full(GLYPH_LOW_BATTERY, /* force_utf= */ true)) < 0) + glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ true)) < 0) return log_oom(); (void) plymouth_send_message("shutdown", plymouth_message); diff --git a/src/boot/boot.c b/src/boot/boot.c index 3ff757c53d6..772edc95a41 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -3133,4 +3133,4 @@ static EFI_STATUS run(EFI_HANDLE image) { } } -DEFINE_EFI_MAIN_FUNCTION(run, "systemd-boot", /* wait_for_debugger= */ false); +DEFINE_EFI_MAIN_FUNCTION(run, "systemd-boot", /*wait_for_debugger=*/false); diff --git a/src/boot/device-path-util.c b/src/boot/device-path-util.c index a40cb5e8a11..d8c8e5780d4 100644 --- a/src/boot/device-path-util.c +++ b/src/boot/device-path-util.c @@ -128,7 +128,7 @@ EFI_STATUS device_path_to_str(const EFI_DEVICE_PATH *dp, char16_t **ret) { return EFI_SUCCESS; } - str = dp_to_text->ConvertDevicePathToText(dp, /* DisplayOnly= */ false, /* AllowShortcuts= */ false); + str = dp_to_text->ConvertDevicePathToText(dp, /* DisplayOnly=*/ false, /* AllowShortcuts= */ false); if (!str) return EFI_OUT_OF_RESOURCES; diff --git a/src/boot/efi-firmware.h b/src/boot/efi-firmware.h index 7cf2fc9730e..9901d7d5c02 100644 --- a/src/boot/efi-firmware.h +++ b/src/boot/efi-firmware.h @@ -5,13 +5,14 @@ #define FWHEADERMAGIC (UINT32_C(0xfeeddead)) -/* The structure of the efifw UKI blob is the following: - * --------------------------------------------------------- - * EfiFw header|fwid|payload| reserved for future attributes - * --------------------------------------------------------- - * The base header defines the length of full header, fwid and payload. - * The fwid is a NUL terminated string. - * The payload contains the actual efi firmware. */ +/* The structure of the efifw UKI blob is the following: + * --------------------------------------------------------- + * EfiFw header|fwid|payload| reserved for future attributes + * --------------------------------------------------------- + * The base header defines the length of full header, fwid and payload. + * The fwid is a NUL terminated string. + * The payload contains the actual efi firmware. + */ typedef struct EfiFwHeader { uint32_t magic; /* magic number that defines Efifw */ uint32_t header_len; /* total length of header including all attributes */ diff --git a/src/boot/linux.c b/src/boot/linux.c index 376b52d72ac..1d6f78254b8 100644 --- a/src/boot/linux.c +++ b/src/boot/linux.c @@ -72,7 +72,7 @@ static EFI_STATUS load_via_boot_services( }); - err = BS->LoadImage(/* BootPolicy= */ false, + err = BS->LoadImage(/* BootPolicy= */false, parent, &kernel_file_path->memmap_path.Header, kernel->iov_base, diff --git a/src/boot/part-discovery.c b/src/boot/part-discovery.c index 0c8e7fde04b..e66e2daf304 100644 --- a/src/boot/part-discovery.c +++ b/src/boot/part-discovery.c @@ -30,7 +30,7 @@ typedef struct { } _packed_ GptHeader; assert_cc(sizeof(GptHeader) == 512); -static bool verify_gpt(/* const */ GptHeader *h, EFI_LBA lba_expected) { +static bool verify_gpt(/*const*/ GptHeader *h, EFI_LBA lba_expected) { uint32_t crc32, crc32_saved; EFI_STATUS err; diff --git a/src/boot/pe.c b/src/boot/pe.c index 8616bee6b65..4e7bb2e84ab 100644 --- a/src/boot/pe.c +++ b/src/boot/pe.c @@ -367,8 +367,8 @@ static void pe_locate_sections( n_section_table, section_names, validate_base, - /* device_table= */ NULL, - /* device= */ NULL, + /* device_table = */ NULL, + /* device = */ NULL, sections); /* It doesn't make sense not to provide validate_base here */ @@ -387,8 +387,8 @@ static void pe_locate_sections( n_section_table, hwid_section_names, validate_base, - /* device_table= */ NULL, - /* device= */ NULL, + /* device_table = */ NULL, + /* device = */ NULL, hwids_section); if (PE_SECTION_VECTOR_IS_SET(hwids_section)) { diff --git a/src/boot/secure-boot.c b/src/boot/secure-boot.c index 5d7ec380f1f..7f599b0bcc2 100644 --- a/src/boot/secure-boot.c +++ b/src/boot/secure-boot.c @@ -166,7 +166,7 @@ EFI_STATUS secure_boot_enroll_at(EFI_FILE *root_dir, const char16_t *path, bool } if (need_custom_mode && !custom_mode_enabled()) { - err = set_custom_mode(/* enable= */ true); + err = set_custom_mode(/* enable = */ true); if (err != EFI_SUCCESS) { log_error_status(err, "Failed to enable custom mode: %m"); goto out_deallocate; diff --git a/src/boot/splash.c b/src/boot/splash.c index 451909eb4ca..7cf8d0d0c94 100644 --- a/src/boot/splash.c +++ b/src/boot/splash.c @@ -69,7 +69,7 @@ static EFI_STATUS bmp_parse_header( if (file->size < file->offset) return EFI_INVALID_PARAMETER; - /* check device-independent bitmap */ + /* check device-independent bitmap */ struct bmp_dib *dib = (struct bmp_dib *) (bmp + sizeof(struct bmp_file)); if (dib->size < SIZEOF_BMP_DIB) return EFI_UNSUPPORTED; diff --git a/src/bootctl/bootctl-install.c b/src/bootctl/bootctl-install.c index 6cabf3785c4..0a2fb1888ba 100644 --- a/src/bootctl/bootctl-install.c +++ b/src/bootctl/bootctl-install.c @@ -377,7 +377,7 @@ static int update_efi_boot_binaries( if (!dest_path) return log_oom(); - r = copy_file_with_version_check(source_path, dest_path, /* force= */ false); + r = copy_file_with_version_check(source_path, dest_path, /* force = */ false); if (IN_SET(r, -ESTALE, -ESRCH)) continue; RET_GATHER(ret, r); @@ -607,7 +607,7 @@ static int efi_timestamp(EFI_TIME *ret) { if (r != -ENXIO) log_debug_errno(r, "Failed to parse $SOURCE_DATE_EPOCH, ignoring: %m"); - r = localtime_or_gmtime_usec(epoch != UINT64_MAX ? epoch : now(CLOCK_REALTIME), /* utc= */ true, &tm); + r = localtime_or_gmtime_usec(epoch != UINT64_MAX ? epoch : now(CLOCK_REALTIME), /*utc=*/ true, &tm); if (r < 0) return log_error_errno(r, "Failed to convert timestamp to calendar time: %m"); @@ -700,7 +700,7 @@ static int install_secure_boot_auto_enroll(const char *esp, X509 *certificate, E return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to write signature list to bio"); _cleanup_(PKCS7_freep) PKCS7 *p7 = NULL; - p7 = PKCS7_sign(certificate, private_key, /* certs= */ NULL, bio, PKCS7_DETACHED|PKCS7_NOATTR|PKCS7_BINARY|PKCS7_NOSMIMECAP); + p7 = PKCS7_sign(certificate, private_key, /*certs=*/ NULL, bio, PKCS7_DETACHED|PKCS7_NOATTR|PKCS7_BINARY|PKCS7_NOSMIMECAP); if (!p7) return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to calculate PKCS7 signature: %s", ERR_error_string(ERR_get_error(), NULL)); @@ -979,7 +979,7 @@ static int load_secure_boot_auto_enroll( } if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } diff --git a/src/bootctl/bootctl-reboot-to-firmware.c b/src/bootctl/bootctl-reboot-to-firmware.c index 9b85f022327..832626fe617 100644 --- a/src/bootctl/bootctl-reboot-to-firmware.c +++ b/src/bootctl/bootctl-reboot-to-firmware.c @@ -68,7 +68,7 @@ int vl_method_set_reboot_to_firmware(sd_varlink *link, sd_json_variant *paramete int vl_method_get_reboot_to_firmware(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) { int r; - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/bootctl/bootctl-status.c b/src/bootctl/bootctl-status.c index 460c332ac73..4e15576affb 100644 --- a/src/bootctl/bootctl-status.c +++ b/src/bootctl/bootctl-status.c @@ -940,7 +940,7 @@ int vl_method_list_boot_entries(sd_varlink *link, sd_json_variant *parameters, s assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -952,7 +952,7 @@ int vl_method_list_boot_entries(sd_varlink *link, sd_json_variant *parameters, s /* ret_part= */ NULL, /* ret_pstart= */ NULL, /* ret_psize= */ NULL, - /* ret_uuid= */ NULL, + /* ret_uuid=*/ NULL, &esp_devid); if (r == -EACCES) /* We really need the ESP path for this call, hence also log about access errors */ return log_error_errno(r, "Failed to determine ESP location: %m"); diff --git a/src/bootctl/bootctl-util.c b/src/bootctl/bootctl-util.c index 23b8786f1d8..f5642827aca 100644 --- a/src/bootctl/bootctl-util.c +++ b/src/bootctl/bootctl-util.c @@ -126,7 +126,7 @@ int settle_entry_token(void) { arg_root, secure_getenv("KERNEL_INSTALL_CONF_ROOT"), arg_machine_id, - /* machine_id_is_random= */ false, + /* machine_id_is_random = */ false, &arg_entry_token_type, &arg_entry_token); if (r < 0) diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 62ee0a14844..5853641e54c 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -1166,7 +1166,7 @@ static int introspect(int argc, char **argv, void *userdata) { TABLE_SET_COLOR, ansi_highlight()); else r = table_add_cell_stringf( - table, /* ret_cell= */ NULL, ".%s", m->name); + table, /* ret_cell = */ NULL, ".%s", m->name); if (r < 0) return table_log_add_error(r); @@ -1725,7 +1725,7 @@ static int bus_message_dump(sd_bus_message *m, uint64_t flags) { return log_error_errno(r, "Failed to rewind: %m"); if (FLAGS_SET(flags, SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY)) { - r = sd_bus_message_peek_type(m, /* ret_type= */ NULL, &contents); + r = sd_bus_message_peek_type(m, /* ret_type = */ NULL, &contents); if (r < 0) return bus_log_parse_error(r); @@ -1765,7 +1765,7 @@ static int bus_message_dump(sd_bus_message *m, uint64_t flags) { fputs(FLAGS_SET(flags, SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY) ? contents : sd_bus_message_get_signature(m, true), stdout); fputc(' ', stdout); - r = format_cmdline(m, stdout, /* needs_space= */ false); + r = format_cmdline(m, stdout, /* needs_space = */ false); if (r < 0) return bus_log_parse_error(r); @@ -1845,7 +1845,7 @@ static int call(int argc, char **argv, void *userdata) { return log_error_errno(r, "Call failed: %s", bus_error_message(&error, r)); } - return bus_message_dump(reply, /* flags= */ 0); + return bus_message_dump(reply, /* flags = */ 0); } static int emit_signal(int argc, char **argv, void *userdata) { @@ -1932,7 +1932,7 @@ static int get_property(int argc, char **argv, void *userdata) { static int on_bus_signal(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) { return sd_event_exit(sd_bus_get_event(sd_bus_message_get_bus(ASSERT_PTR(msg))), - bus_message_dump(msg, /* flags= */ 0)); + bus_message_dump(msg, /* flags = */ 0)); } static int wait_signal(int argc, char **argv, void *userdata) { diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index bb1b256902b..87806caeba1 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -908,7 +908,7 @@ static int loop(const char *root) { if (t >= usec_add(last_refresh, arg_delay) || immediate_refresh) { - r = refresh(root, a, b, iteration++, /* depth= */ 0, /* ret= */ NULL); + r = refresh(root, a, b, iteration++, /* depth = */ 0, /* ret = */ NULL); if (r < 0) return log_error_errno(r, "Failed to refresh: %m"); diff --git a/src/core/automount.c b/src/core/automount.c index 05b35d06a4c..ddb524d01a4 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -262,7 +262,7 @@ static void automount_set_state(Automount *a, AutomountState state) { if (state != old_state) log_unit_debug(UNIT(a), "Changed %s -> %s", automount_state_to_string(old_state), automount_state_to_string(state)); - unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static int automount_coldplug(Unit *u) { @@ -781,7 +781,7 @@ static void automount_enter_running(Automount *a) { goto fail; } - r = manager_add_job(UNIT(a)->manager, JOB_START, trigger, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(UNIT(a)->manager, JOB_START, trigger, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) { log_unit_warning(UNIT(a), "Failed to queue mount startup job: %s", bus_error_message(&error, r)); goto fail; @@ -997,7 +997,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo goto fail; } - r = manager_add_job(UNIT(a)->manager, JOB_STOP, trigger, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(UNIT(a)->manager, JOB_STOP, trigger, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) { log_unit_warning(UNIT(a), "Failed to queue unmount job: %s", bus_error_message(&error, r)); goto fail; diff --git a/src/core/bpf-devices.c b/src/core/bpf-devices.c index aeb01e85753..71ffd048986 100644 --- a/src/core/bpf-devices.c +++ b/src/core/bpf-devices.c @@ -236,7 +236,7 @@ int bpf_devices_apply_policy( if (r < 0) return log_error_errno(r, "Extending device control BPF program failed: %m"); - r = cg_get_path(cgroup_path, /* suffix= */ NULL, &controller_path); + r = cg_get_path(cgroup_path, /* suffix = */ NULL, &controller_path); if (r < 0) return log_error_errno(r, "Failed to determine cgroup path: %m"); diff --git a/src/core/bpf-firewall.c b/src/core/bpf-firewall.c index b0c54d31347..b2a4cd6e27b 100644 --- a/src/core/bpf-firewall.c +++ b/src/core/bpf-firewall.c @@ -696,7 +696,7 @@ int bpf_firewall_install(Unit *u) { return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EOPNOTSUPP), "bpf-firewall: BPF firewalling not supported, proceeding without."); - r = cg_get_path(crt->cgroup_path, /* suffix= */ NULL, &path); + r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &path); if (r < 0) return log_unit_error_errno(u, r, "bpf-firewall: Failed to determine cgroup path: %m"); diff --git a/src/core/bpf-foreign.c b/src/core/bpf-foreign.c index dfc8e0c17b1..1da16a7b8d9 100644 --- a/src/core/bpf-foreign.c +++ b/src/core/bpf-foreign.c @@ -151,7 +151,7 @@ int bpf_foreign_install(Unit *u) { if (!crt) return 0; - r = cg_get_path(crt->cgroup_path, /* suffix= */ NULL, &cgroup_path); + r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path); if (r < 0) return log_unit_error_errno(u, r, "bpf-foreign: Failed to get cgroup path: %m"); diff --git a/src/core/bpf-restrict-fs.c b/src/core/bpf-restrict-fs.c index 8df2f5235c8..916454bc6ef 100644 --- a/src/core/bpf-restrict-fs.c +++ b/src/core/bpf-restrict-fs.c @@ -207,7 +207,7 @@ int bpf_restrict_fs_cleanup(Unit *u) { assert(u->manager); /* If we never successfully detected support, there is nothing to clean up. */ - if (!bpf_restrict_fs_supported(/* initialize= */ false)) + if (!bpf_restrict_fs_supported(/* initialize = */ false)) return 0; if (!u->manager->restrict_fs) diff --git a/src/core/bpf-restrict-ifaces.c b/src/core/bpf-restrict-ifaces.c index 29df72f2b06..a0ed94ce3ad 100644 --- a/src/core/bpf-restrict-ifaces.c +++ b/src/core/bpf-restrict-ifaces.c @@ -115,7 +115,7 @@ static int restrict_ifaces_install_impl(Unit *u) { if (!crt) return 0; - r = cg_get_path(crt->cgroup_path, /* suffix= */ NULL, &cgroup_path); + r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path); if (r < 0) return log_unit_error_errno(u, r, "restrict-interfaces: Failed to get cgroup path: %m"); diff --git a/src/core/bpf-socket-bind.c b/src/core/bpf-socket-bind.c index b7158841fa0..eef9c01987a 100644 --- a/src/core/bpf-socket-bind.c +++ b/src/core/bpf-socket-bind.c @@ -128,7 +128,7 @@ int bpf_socket_bind_supported(void) { if (dlopen_bpf_full(LOG_WARNING) < 0) return false; - r = prepare_socket_bind_bpf(/* unit= */ NULL, /* allow_rules= */ NULL, /* deny_rules= */ NULL, &obj); + r = prepare_socket_bind_bpf(/*unit=*/NULL, /*allow_rules=*/NULL, /*deny_rules=*/NULL, &obj); if (r < 0) { log_debug_errno(r, "bpf-socket-bind: socket bind filtering is not supported: %m"); return false; @@ -179,7 +179,7 @@ static int socket_bind_install_impl(Unit *u) { if (!crt) return 0; - r = cg_get_path(crt->cgroup_path, /* suffix= */ NULL, &cgroup_path); + r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path); if (r < 0) return log_unit_error_errno(u, r, "bpf-socket-bind: Failed to get cgroup path: %m"); diff --git a/src/core/cgroup.c b/src/core/cgroup.c index f2418a3fa87..374976edb1e 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1609,7 +1609,7 @@ static void cgroup_context_apply( if (apply_mask & CGROUP_MASK_BPF_RESTRICT_NETWORK_INTERFACES) cgroup_apply_restrict_network_interfaces(u); - unit_modify_nft_set(u, /* add= */ true); + unit_modify_nft_set(u, /* add = */ true); } static bool unit_get_needs_bpf_firewall(Unit *u) { @@ -1931,7 +1931,7 @@ static int unit_set_cgroup_path(Unit *u, const char *path) { if (crt && streq_ptr(crt->cgroup_path, path)) return 0; - unit_release_cgroup(u, /* drop_cgroup_runtime= */ true); + unit_release_cgroup(u, /* drop_cgroup_runtime = */ true); crt = unit_setup_cgroup_runtime(u); if (!crt) @@ -2101,7 +2101,7 @@ static int unit_update_cgroup( CGroupRuntime *crt = ASSERT_PTR(unit_get_cgroup_runtime(u)); uint64_t cgroup_id = 0; - r = cg_get_path(crt->cgroup_path, /* suffix= */ NULL, &cgroup_full_path); + r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_full_path); if (r == 0) { r = cg_path_get_cgroupid(cgroup_full_path, &cgroup_id); if (r < 0) @@ -2735,7 +2735,7 @@ static bool unit_maybe_release_cgroup(Unit *u) { /* Do not free CGroupRuntime when called from unit_prune_cgroup. Various accounting data * we should keep, especially CPU usage and *_peak ones which would be shown even after * the unit stops. */ - unit_release_cgroup(u, /* drop_cgroup_runtime= */ false); + unit_release_cgroup(u, /* drop_cgroup_runtime = */ false); return true; } @@ -2793,13 +2793,13 @@ void unit_prune_cgroup(Unit *u) { return; /* Cache the last resource usage values before we destroy the cgroup */ - (void) unit_get_cpu_usage(u, /* ret= */ NULL); + (void) unit_get_cpu_usage(u, /* ret = */ NULL); for (CGroupMemoryAccountingMetric metric = 0; metric <= _CGROUP_MEMORY_ACCOUNTING_METRIC_CACHED_LAST; metric++) - (void) unit_get_memory_accounting(u, metric, /* ret= */ NULL); + (void) unit_get_memory_accounting(u, metric, /* ret = */ NULL); /* All IO metrics are read at once from the underlying cgroup, so issue just a single call */ - (void) unit_get_io_accounting(u, _CGROUP_IO_ACCOUNTING_METRIC_INVALID, /* ret= */ NULL); + (void) unit_get_io_accounting(u, _CGROUP_IO_ACCOUNTING_METRIC_INVALID, /* ret = */ NULL); /* We do not cache IP metrics here because the firewall objects are not freed with cgroups */ @@ -2807,7 +2807,7 @@ void unit_prune_cgroup(Unit *u) { (void) bpf_restrict_fs_cleanup(u); /* Remove cgroup from the global LSM BPF map */ #endif - unit_modify_nft_set(u, /* add= */ false); + unit_modify_nft_set(u, /* add = */ false); is_root_slice = unit_has_name(u, SPECIAL_ROOT_SLICE); @@ -3316,7 +3316,7 @@ int manager_setup_cgroup(Manager *m) { /* 5. Make sure we are in the special "init.scope" unit in the root slice. */ const char *scope_path = strjoina(m->cgroup_root, "/" SPECIAL_INIT_SCOPE); - r = cg_create_and_attach(scope_path, /* pid= */ 0); + r = cg_create_and_attach(scope_path, /* pid = */ 0); if (r >= 0) { /* Also, move all other userspace processes remaining in the root cgroup into that scope. */ r = cg_migrate(m->cgroup_root, scope_path, 0); @@ -4169,8 +4169,8 @@ CGroupRuntime* cgroup_runtime_new(void) { .deserialized_cgroup_realized = -1, }; - unit_reset_cpu_accounting(/* unit= */ NULL, crt); - unit_reset_io_accounting(/* unit= */ NULL, crt); + unit_reset_cpu_accounting(/* unit = */ NULL, crt); + unit_reset_io_accounting(/* unit = */ NULL, crt); cgroup_runtime_reset_memory_accounting_last(crt); assert_se(cgroup_runtime_reset_ip_accounting(crt) >= 0); diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index b7d8b4b5ff8..5a0b083b97d 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -605,12 +605,12 @@ static int property_get_log_filter_patterns( return r; r = sd_bus_message_append_log_filter_patterns(reply, c->log_filter_allowed_patterns, - /* is_allowlist= */ true); + /* is_allowlist = */ true); if (r < 0) return r; r = sd_bus_message_append_log_filter_patterns(reply, c->log_filter_denied_patterns, - /* is_allowlist= */ false); + /* is_allowlist = */ false); if (r < 0) return r; @@ -2248,7 +2248,7 @@ int bus_exec_context_set_transient_property( if (r < 0) return r; - if (!isempty(h) && !hostname_is_valid(h, /* flags= */ 0)) + if (!isempty(h) && !hostname_is_valid(h, /* flags = */ 0)) return sd_bus_error_setf(reterr_error, SD_BUS_ERROR_INVALID_ARGS, "Invalid hostname in %s setting: %s", name, h); ProtectHostname t = protect_hostname_from_string(s); diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index a2fd5889838..e97b36e5d3c 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -758,31 +758,31 @@ static int method_start_unit_generic(sd_bus_message *message, Manager *m, JobTyp } static int method_start_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_START, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, userdata, JOB_START, /* reload_if_possible = */ false, reterr_error); } static int method_stop_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_STOP, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, userdata, JOB_STOP, /* reload_if_possible = */ false, reterr_error); } static int method_reload_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_RELOAD, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, userdata, JOB_RELOAD, /* reload_if_possible = */ false, reterr_error); } static int method_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_RESTART, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, userdata, JOB_RESTART, /* reload_if_possible = */ false, reterr_error); } static int method_try_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_TRY_RESTART, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, userdata, JOB_TRY_RESTART, /* reload_if_possible = */ false, reterr_error); } static int method_reload_or_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_RESTART, /* reload_if_possible= */ true, reterr_error); + return method_start_unit_generic(message, userdata, JOB_RESTART, /* reload_if_possible = */ true, reterr_error); } static int method_reload_or_try_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_start_unit_generic(message, userdata, JOB_TRY_RESTART, /* reload_if_possible= */ true, reterr_error); + return method_start_unit_generic(message, userdata, JOB_TRY_RESTART, /* reload_if_possible = */ true, reterr_error); } typedef enum GenericUnitOperationFlags { @@ -857,19 +857,19 @@ static int method_start_unit_replace(sd_bus_message *message, void *userdata, sd if (!u->job || u->job->type != JOB_START) return sd_bus_error_setf(reterr_error, BUS_ERROR_NO_SUCH_JOB, "No job queued for unit %s", old_name); - return method_start_unit_generic(message, m, JOB_START, /* reload_if_possible= */ false, reterr_error); + return method_start_unit_generic(message, m, JOB_START, /* reload_if_possible = */ false, reterr_error); } static int method_kill_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { /* We don't bother with GENERIC_UNIT_LOAD or GENERIC_UNIT_VALIDATE_LOADED here, as it shouldn't * matter whether a unit is loaded for killing any processes in the unit's cgroup. */ - return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_kill, /* flags= */ 0); + return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_kill, /* flags = */ 0); } static int method_kill_unit_subgroup(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { /* We don't bother with GENERIC_UNIT_LOAD or GENERIC_UNIT_VALIDATE_LOADED here, as it shouldn't * matter whether a unit is loaded for killing any processes in the unit's cgroup. */ - return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_kill_subgroup, /* flags= */ 0); + return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_kill_subgroup, /* flags = */ 0); } static int method_clean_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { @@ -891,7 +891,7 @@ static int method_thaw_unit(sd_bus_message *message, void *userdata, sd_bus_erro static int method_reset_failed_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { /* Don't load the unit (because unloaded units can't be in failed state), and don't insist on the * unit to be loaded properly (since a failed unit might have its unit file disappeared) */ - return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_reset_failed, /* flags= */ 0); + return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_reset_failed, /* flags = */ 0); } static int method_set_unit_properties(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { @@ -917,7 +917,7 @@ static int method_ref_unit(sd_bus_message *message, void *userdata, sd_bus_error static int method_unref_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { /* Dropping a ref OTOH should not require the unit to still be loaded. And since a reffed unit is a * loaded unit there's no need to load the unit for unreffing it. */ - return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_unref, /* flags= */ 0); + return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_unref, /* flags = */ 0); } static int reply_unit_info(sd_bus_message *reply, Unit *u) { @@ -996,7 +996,7 @@ static int method_get_unit_processes(sd_bus_message *message, void *userdata, sd /* Don't load a unit actively (since it won't have any processes if it's not loaded), but don't * insist on the unit being loaded either (because even improperly loaded units might still have * processes around). */ - return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_get_processes, /* flags= */ 0); + return method_generic_unit_operation(message, userdata, reterr_error, _UNIT_TYPE_INVALID, bus_unit_method_get_processes, /* flags = */ 0); } static int method_attach_processes_to_unit(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { @@ -1094,7 +1094,7 @@ static int transient_aux_units_from_message( if (r < 0) return r; - r = transient_unit_from_message(m, message, name, /* ret_unit= */ NULL, reterr_error); + r = transient_unit_from_message(m, message, name, /* ret_unit = */ NULL, reterr_error); if (r < 0) return r; @@ -1457,11 +1457,11 @@ static int dump_impl( * operations, and can cause PID1 to stall. So it seems similar enough in terms of security * considerations and impact, and thus use the same access check for dumps which, given the * large amount of data to fetch, can stall PID1 for quite some time. */ - r = mac_selinux_access_check(message, "reload", /* error= */ NULL); + r = mac_selinux_access_check(message, "reload", /* error = */ NULL); if (r < 0) goto ratelimited; - r = bus_verify_bypass_dump_ratelimit_async(m, message, /* reterr_error= */ NULL); + r = bus_verify_bypass_dump_ratelimit_async(m, message, /* reterr_error = */ NULL); if (r < 0) goto ratelimited; if (r == 0) @@ -2180,7 +2180,7 @@ static int list_unit_files_by_patterns(sd_bus_message *message, void *userdata, if (r < 0) return r; - r = unit_file_get_list(m->runtime_scope, /* root_dir= */ NULL, states, patterns, &h); + r = unit_file_get_list(m->runtime_scope, /* root_dir = */ NULL, states, patterns, &h); if (r < 0) return r; @@ -2446,19 +2446,19 @@ static int method_enable_unit_files_generic( } static int method_enable_unit_files_with_flags(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_enable, /* carries_install_info= */ true, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_enable, /* carries_install_info = */ true, reterr_error); } static int method_enable_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_enable, /* carries_install_info= */ true, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_enable, /* carries_install_info = */ true, reterr_error); } static int method_reenable_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_reenable, /* carries_install_info= */ true, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_reenable, /* carries_install_info = */ true, reterr_error); } static int method_link_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_link, /* carries_install_info= */ false, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_link, /* carries_install_info = */ false, reterr_error); } static int unit_file_preset_without_mode(RuntimeScope scope, UnitFileFlags flags, const char *root_dir, char * const *files, InstallChange **changes, size_t *n_changes) { @@ -2466,11 +2466,11 @@ static int unit_file_preset_without_mode(RuntimeScope scope, UnitFileFlags flags } static int method_preset_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_preset_without_mode, /* carries_install_info= */ true, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_preset_without_mode, /* carries_install_info = */ true, reterr_error); } static int method_mask_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_enable_unit_files_generic(message, userdata, unit_file_mask, /* carries_install_info= */ false, reterr_error); + return method_enable_unit_files_generic(message, userdata, unit_file_mask, /* carries_install_info = */ false, reterr_error); } static int method_preset_unit_files_with_mode(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { @@ -2573,19 +2573,19 @@ static int method_disable_unit_files_generic( } static int method_disable_unit_files_with_flags(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info= */ false, reterr_error); + return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info = */ false, reterr_error); } static int method_disable_unit_files_with_flags_and_install_info(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info= */ true, reterr_error); + return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info = */ true, reterr_error); } static int method_disable_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info= */ false, reterr_error); + return method_disable_unit_files_generic(message, userdata, unit_file_disable, /* carries_install_info = */ false, reterr_error); } static int method_unmask_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { - return method_disable_unit_files_generic(message, userdata, unit_file_unmask, /* carries_install_info= */ false, reterr_error); + return method_disable_unit_files_generic(message, userdata, unit_file_unmask, /* carries_install_info = */ false, reterr_error); } static int method_revert_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *reterr_error) { diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 730b1a05454..148384edcfb 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -1392,7 +1392,7 @@ static int append_cgroup(sd_bus_message *reply, const char *p, Set *pids) { * We'll see ENODEV when trying to enumerate processes and the cgroup is removed at the same * time. Handle this gracefully. */ - r = cg_read_pidref(f, &pidref, /* flags= */ 0); + r = cg_read_pidref(f, &pidref, /* flags = */ 0); if (IN_SET(r, 0, -EOPNOTSUPP, -ENODEV)) break; if (r < 0) @@ -2005,7 +2005,7 @@ int bus_unit_queue_job_one( return -ENOMEM; } - r = manager_add_job_full(u->manager, type, u, mode, /* extra_flags= */ 0, affected, reterr_error, &j); + r = manager_add_job_full(u->manager, type, u, mode, /* extra_flags = */ 0, affected, reterr_error, &j); if (r < 0) return r; diff --git a/src/core/dbus.c b/src/core/dbus.c index 30d265ec6ce..0ee35785846 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -128,7 +128,7 @@ static int signal_activation_request(sd_bus_message *message, void *userdata, sd goto failed; } - r = manager_add_job(m, JOB_START, u, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(m, JOB_START, u, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) goto failed; diff --git a/src/core/device.c b/src/core/device.c index ef3c182cbb9..9f206cef3b5 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -177,7 +177,7 @@ static void device_set_state(Device *d, DeviceState state) { if (state != old_state) log_unit_debug(UNIT(d), "Changed %s -> %s", device_state_to_string(old_state), device_state_to_string(state)); - unit_notify(UNIT(d), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(d), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static void device_found_changed(Device *d, DeviceFound previous, DeviceFound now) { @@ -800,7 +800,7 @@ static int device_setup_devlink_unit_one(Manager *m, const char *devlink, Set ** /* Note, even if the device is being processed by udevd, setup the unit on enumerate. * See also the comments in device_catchup(). */ - return device_setup_unit(m, dev, devlink, /* main= */ false, ready_units); + return device_setup_unit(m, dev, devlink, /* main = */ false, ready_units); } /* the devlink is already removed or not ready */ @@ -866,7 +866,7 @@ static int device_setup_extra_units(Manager *m, sd_device *dev, Set **ready_unit * To achieve that, they set the path to SYSTEMD_ALIAS. Hence, we cannot refuse aliases start * with /dev/, unfortunately. */ - (void) device_setup_unit(m, dev, *alias, /* main= */ false, ready_units); + (void) device_setup_unit(m, dev, *alias, /* main = */ false, ready_units); } l = hashmap_get(m->devices_by_sysfs, syspath); @@ -925,13 +925,13 @@ static int device_setup_units(Manager *m, sd_device *dev, Set **ret_ready_units, /* Add the main unit named after the syspath. If this one fails, don't bother with the rest, * as this one shall be the main device unit the others just follow. (Compare with how * device_following() is implemented, see below, which looks for the sysfs device.) */ - r = device_setup_unit(m, dev, syspath, /* main= */ true, &ready_units); + r = device_setup_unit(m, dev, syspath, /* main = */ true, &ready_units); if (r < 0) return r; /* Add an additional unit for the device node */ if (sd_device_get_devname(dev, &devname) >= 0) - (void) device_setup_unit(m, dev, devname, /* main= */ false, &ready_units); + (void) device_setup_unit(m, dev, devname, /* main = */ false, &ready_units); } else { Unit *u; @@ -1272,7 +1272,7 @@ void device_found_node(Manager *m, const char *node, DeviceFound found, DeviceFo return; } - (void) device_setup_unit(m, dev, node, /* main= */ false, NULL); /* 'dev' may be NULL. */ + (void) device_setup_unit(m, dev, node, /* main = */ false, NULL); /* 'dev' may be NULL. */ } /* Update the device unit's state, should it exist */ diff --git a/src/core/exec-credential.c b/src/core/exec-credential.c index 3d7f066400b..97c4133d578 100644 --- a/src/core/exec-credential.c +++ b/src/core/exec-credential.c @@ -29,6 +29,7 @@ #include "stat-util.h" #include "string-util.h" #include "strv.h" +#include "tmpfile-util.h" #include "user-util.h" ExecSetCredential* exec_set_credential_free(ExecSetCredential *sc) { @@ -319,6 +320,7 @@ static int write_credential( gid_t gid, bool ownership_ok) { + _cleanup_free_ char *tmp = NULL; _cleanup_close_ int fd = -EBADF; int r; @@ -326,10 +328,16 @@ static int write_credential( assert(id); assert(data || size == 0); - fd = openat(dfd, id, O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC, 0600); + r = tempfn_random_child("", "cred", &tmp); + if (r < 0) + return r; + + fd = openat(dfd, tmp, O_CREAT|O_RDWR|O_CLOEXEC|O_EXCL|O_NOFOLLOW|O_NOCTTY, 0600); if (fd < 0) return -errno; + CLEANUP_TMPFILE_AT(dfd, tmp); + r = loop_write(fd, data, size); if (r < 0) return r; @@ -351,6 +359,11 @@ static int write_credential( return r; } + r = RET_NERRNO(renameat(dfd, tmp, dfd, id)); + if (r < 0) + return r; + + tmp = mfree(tmp); /* disarm CLEANUP_TMPFILE_AT() */ return 0; } @@ -536,7 +549,7 @@ static int load_credential_glob( if (!j) return -ENOMEM; - r = safe_glob(j, /* flags= */ 0, &paths); + r = safe_glob(j, /* flags = */ 0, &paths); if (r == -ENOENT) continue; if (r < 0) @@ -783,18 +796,27 @@ static int acquire_credentials( const CGroupContext *cgroup_context, const ExecParameters *params, const char *unit, - int dfd, + const char *p, uid_t uid, gid_t gid, bool ownership_ok) { + _cleanup_close_ int dfd = -EBADF; int r; assert(context); assert(cgroup_context); assert(params); assert(unit); - assert(dfd >= 0); + assert(p); + + dfd = open(p, O_DIRECTORY|O_CLOEXEC); + if (dfd < 0) + return -errno; + + r = fd_acl_make_writable(dfd); /* Add the "w" bit, if we are reusing an already set up credentials dir where it was unset */ + if (r < 0) + return r; struct load_cred_args args = { .context = context, @@ -901,15 +923,7 @@ static int acquire_credentials( return r; } - return 0; -} - -static int credentials_dir_finalize_permissions(int dfd, uid_t uid, gid_t gid, bool ownership_ok) { - int r; - - assert(dfd >= 0); - - r = fd_acl_make_read_only(dfd); /* Take away the "w" bit */ + r = fd_acl_make_read_only(dfd); /* Now take away the "w" bit */ if (r < 0) return r; @@ -933,165 +947,157 @@ static int credentials_dir_finalize_permissions(int dfd, uid_t uid, gid_t gid, b return 0; } -static int setup_credentials_plain_dir( +static int setup_credentials_internal( const ExecContext *context, const CGroupContext *cgroup_context, const ExecParameters *params, const char *unit, - const char *cred_dir, + const char *final, /* This is where the credential store shall eventually end up at */ + const char *workspace, /* This is where we can prepare it before moving it to the final place */ + bool reuse_workspace, /* Whether to reuse any existing workspace mount if it already is a mount */ + bool must_mount, /* Whether to require that we mount something, it's not OK to use the plain directory fall back */ uid_t uid, gid_t gid) { - _cleanup_free_ char *t = NULL, *workspace = NULL; - _cleanup_(rm_rf_safep) const char *workspace_rm = NULL; - _cleanup_close_ int dfd = -EBADF; - int r; + bool final_mounted; + int r, workspace_mounted; /* negative if we don't know yet whether we have/can mount something; true + * if we mounted something; false if we definitely can't mount anything */ assert(context); assert(params); assert(unit); - assert(cred_dir); + assert(final); + assert(workspace); - /* Temporary workspace, that remains inaccessible all the time. We prepare stuff there before moving - * it into place, so that users can't access half-initialized credential stores. */ - t = path_join(params->prefix[EXEC_DIRECTORY_RUNTIME], "systemd/temporary-credentials"); - if (!t) - return -ENOMEM; - - r = mkdir_label(t, 0700); - if (r < 0 && r != -EEXIST) - return r; - - workspace = path_join(t, unit); - if (!workspace) - return -ENOMEM; - - dfd = open_mkdir(workspace, O_CLOEXEC|O_EXCL, 0700); - if (dfd < 0) - return log_debug_errno(dfd, "Failed to create workspace for credentials: %m"); - workspace_rm = workspace; - - (void) label_fix_full(dfd, /* inode_path= */ NULL, cred_dir, /* flags= */ 0); - - r = acquire_credentials(context, cgroup_context, params, unit, dfd, uid, gid, /* ownership_ok= */ false); + r = path_is_mount_point(final); if (r < 0) - return r; - - r = RET_NERRNO(rename(workspace, cred_dir)); - if (r >= 0) - workspace_rm = NULL; - if (IN_SET(r, -ENOTEMPTY, -EEXIST)) { - _cleanup_close_ int old_dfd = open(cred_dir, O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW); - if (old_dfd < 0) - return log_debug_errno(errno, "Failed to open credentials dir '%s': %m", cred_dir); + return log_debug_errno(r, "Failed to determine if '%s' is a mountpoint: %m", final); + final_mounted = r > 0; - (void) fd_acl_make_writable(old_dfd); + if (final_mounted) { + if (FLAGS_SET(params->flags, EXEC_SETUP_CREDENTIALS_FRESH)) { + r = umount_verbose(LOG_DEBUG, final, MNT_DETACH|UMOUNT_NOFOLLOW); + if (r < 0) + return r; - log_debug_errno(r, "Credential dir '%s' already populated, exchanging with workspace.", cred_dir); - r = RET_NERRNO(renameat2(AT_FDCWD, workspace, AT_FDCWD, cred_dir, RENAME_EXCHANGE)); + final_mounted = false; + } else { + /* We can reuse the previous credential dir */ + r = dir_is_empty(final, /* ignore_hidden_or_backup = */ false); + if (r < 0) + return r; + if (r == 0) { + log_debug("Credential dir for unit '%s' already set up, skipping.", unit); + return 0; + } + } } - if (r < 0) - return log_debug_errno(r, "Failed to move credentials workspace into place: %m"); - - /* rename() requires both the source and target to be writable, hence lock down write permission - * as last step. */ - r = credentials_dir_finalize_permissions(dfd, uid, gid, /* ownership_ok= */ false); - if (r < 0) - return log_debug_errno(r, "Failed to adjust ACLs of credentials dir: %m"); - return 0; -} - -static int setup_credentials_internal( - const ExecContext *context, - const CGroupContext *cgroup_context, - const ExecParameters *params, - const char *unit, - const char *cred_dir, - uid_t uid, - gid_t gid) { - - _cleanup_close_ int fs_fd = -EBADF, mfd = -EBADF, dfd = -EBADF; - bool dir_mounted; - int r; - - assert(context); - assert(params); - assert(unit); - assert(cred_dir); - - if (!FLAGS_SET(params->flags, EXEC_SETUP_CREDENTIALS_FRESH)) { - /* We may reuse the previous credential dir */ - r = dir_is_empty(cred_dir, /* ignore_hidden_or_backup= */ false); + if (reuse_workspace) { + r = path_is_mount_point(workspace); if (r < 0) return r; - if (r == 0) { - log_debug("Credential dir for unit '%s' already set up, skipping.", unit); - return 0; - } + if (r > 0) + workspace_mounted = true; /* If this is already a mount, and we are supposed to reuse + * it, let's keep this in mind */ + else + workspace_mounted = -1; /* We need to figure out if we can mount something to the workspace */ + } else + workspace_mounted = -1; /* ditto */ + + /* If both the final place and the workspace are mounted, we have no mounts to set up, based on + * the assumption that they're actually the same tmpfs (but the latter with MS_RDONLY different). + * If the workspace is not mounted, we just bind the final place over and make it writable. */ + must_mount = must_mount || final_mounted; + + if (workspace_mounted < 0) { + if (!final_mounted) + /* Nothing is mounted on the workspace yet, let's try to mount a new tmpfs if + * not using the final place. */ + r = mount_credentials_fs(workspace, CREDENTIALS_TOTAL_SIZE_MAX, /* ro= */ false); + if (final_mounted || r < 0) { + /* If using final place or failed to mount new tmpfs, make a bind mount from + * the final to the workspace, so that we can make it writable there. */ + r = mount_nofollow_verbose(LOG_DEBUG, final, workspace, NULL, MS_BIND|MS_REC, NULL); + if (r < 0) { + if (!ERRNO_IS_PRIVILEGE(r)) + /* Propagate anything that isn't a permission problem. */ + return r; + + if (must_mount) + /* If it's not OK to use the plain directory fallback, propagate all + * errors too. */ + return r; + + /* If we lack privileges to bind mount stuff, then let's gracefully proceed + * for compat with container envs, and just use the final dir as is. + * Final place must not be mounted in this case (refused by must_mount + * above) */ + + workspace_mounted = false; + } else { + /* Make the new bind mount writable (i.e. drop MS_RDONLY) */ + r = mount_nofollow_verbose(LOG_DEBUG, + NULL, + workspace, + NULL, + MS_BIND|MS_REMOUNT|credentials_fs_mount_flags(/* ro= */ false), + NULL); + if (r < 0) + return r; + + workspace_mounted = true; + } + } else + workspace_mounted = true; } - r = path_is_mount_point(cred_dir); - if (r < 0) - return log_debug_errno(r, "Failed to determine if '%s' is a mountpoint: %m", cred_dir); - dir_mounted = r > 0; + assert(workspace_mounted >= 0); + assert(!must_mount || workspace_mounted); - mfd = fsmount_credentials_fs(&fs_fd); - if (ERRNO_IS_NEG_PRIVILEGE(mfd) && !dir_mounted) { - log_debug_errno(mfd, "Lacking privilege to mount credentials fs, falling back to plain directory."); - return setup_credentials_plain_dir(context, cgroup_context, params, unit, cred_dir, uid, gid); - } - if (mfd < 0) - return log_debug_errno(mfd, "Failed to mount credentials fs: %m"); + const char *where = workspace_mounted ? workspace : final; - dfd = fd_reopen(mfd, O_DIRECTORY|O_CLOEXEC); - if (dfd < 0) - return dfd; + (void) label_fix_full(AT_FDCWD, where, final, 0); - (void) label_fix_full(dfd, /* inode_path= */ NULL, cred_dir, /* flags= */ 0); + r = acquire_credentials(context, cgroup_context, params, unit, where, uid, gid, workspace_mounted); + if (r < 0) { + /* If we're using final place as workspace, and failed to acquire credentials, we might + * have left half-written creds there. Let's get rid of the whole mount, so future + * calls won't reuse it. */ + if (final_mounted) + (void) umount_verbose(LOG_DEBUG, final, MNT_DETACH|UMOUNT_NOFOLLOW); - r = acquire_credentials(context, cgroup_context, params, unit, dfd, uid, gid, /* ownership_ok= */ true); - if (r < 0) return r; + } - r = credentials_dir_finalize_permissions(dfd, uid, gid, /* ownership_ok= */ true); - if (r < 0) - return log_debug_errno(r, "Failed to adjust ACLs of credentials dir: %m"); - - // Work around a kernel bug that results in tmpfs reconfiguration failure. - // FIXME: drop this once https://lore.kernel.org/linux-fsdevel/20251108190930.440685-1-me@yhndnzj.com/ - // is merged and hits the distro kernels. - (void) fsconfig(fs_fd, FSCONFIG_SET_FLAG, "noswap", NULL, 0); - - if (fsconfig(fs_fd, FSCONFIG_SET_FLAG, "ro", NULL, 0) < 0) - return -errno; - - if (fsconfig(fs_fd, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) < 0) - return -errno; - - log_debug("Successfully reconfigured credentials fs to be read only."); + if (workspace_mounted) { + if (!final_mounted) { + /* Make workspace read-only now, so that any bind mount we make from it defaults to + * read-only too */ + r = mount_nofollow_verbose(LOG_DEBUG, NULL, workspace, NULL, MS_BIND|MS_REMOUNT|credentials_fs_mount_flags(/* ro= */ true), NULL); + if (r < 0) + return r; - if (dir_mounted) { - /* Firstly, try to move beneath the existing mount, which guarantees strictly atomic replacement - * (needs kernel >= 6.5) */ - r = move_mount(mfd, "", AT_FDCWD, cred_dir, MOVE_MOUNT_F_EMPTY_PATH|MOVE_MOUNT_BENEATH); - if (r >= 0) - return umount_verbose(LOG_DEBUG, cred_dir, MNT_DETACH|UMOUNT_NOFOLLOW); - if (errno != EINVAL) - return log_debug_errno(errno, "Failed to move credentials fs into place: %m"); + /* And mount it to the final place, read-only */ + r = mount_nofollow_verbose(LOG_DEBUG, workspace, final, NULL, MS_MOVE, NULL); + } else + /* Otherwise we just get rid of the bind mount of final place */ + r = umount_verbose(LOG_DEBUG, workspace, MNT_DETACH|UMOUNT_NOFOLLOW); + if (r < 0) + return r; + } else { + _cleanup_free_ char *parent = NULL; - log_debug_errno(errno, "Unable to move credentials fs beneath existing mount '%s', unmounting instead: %m", - cred_dir); + /* If we do not have our own mount put used the plain directory fallback, then we need to + * open access to the top-level credential directory and the per-service directory now */ - r = umount_verbose(LOG_DEBUG, cred_dir, MNT_DETACH|UMOUNT_NOFOLLOW); + r = path_extract_directory(final, &parent); if (r < 0) return r; + if (chmod(parent, 0755) < 0) + return -errno; } - r = move_mount(mfd, "", AT_FDCWD, cred_dir, MOVE_MOUNT_F_EMPTY_PATH); - if (r < 0) - return log_debug_errno(errno, "Failed to move credentials fs into place: %m"); - return 0; } @@ -1134,12 +1140,96 @@ int exec_setup_credentials( if (r < 0 && r != -EEXIST) return r; - r = setup_credentials_internal(context, cgroup_context, params, unit, p, uid, gid); + r = safe_fork("(sd-mkdcreds)", FORK_DEATHSIG_SIGTERM|FORK_WAIT|FORK_NEW_MOUNTNS, NULL); + if (r < 0) { + _cleanup_(rmdir_and_freep) char *u = NULL; /* remove the temporary workspace if we can */ + _cleanup_free_ char *t = NULL; + + /* If this is not a privilege or support issue then propagate the error */ + if (!ERRNO_IS_NOT_SUPPORTED(r) && !ERRNO_IS_PRIVILEGE(r)) + return r; + + /* Temporary workspace, that remains inaccessible all the time. We prepare stuff there before moving + * it into place, so that users can't access half-initialized credential stores. */ + t = path_join(params->prefix[EXEC_DIRECTORY_RUNTIME], "systemd/temporary-credentials"); + if (!t) + return -ENOMEM; + + /* We can't set up a mount namespace. In that case operate on a fixed, inaccessible per-unit + * directory outside of /run/credentials/ first, and then move it over to /run/credentials/ + * after it is fully set up */ + u = path_join(t, unit); + if (!u) + return -ENOMEM; + + FOREACH_STRING(i, t, u) { + r = mkdir_label(i, 0700); + if (r < 0 && r != -EEXIST) + return log_debug_errno(r, "Failed to make directory '%s': %m", i); + } + + r = setup_credentials_internal( + context, + cgroup_context, + params, + unit, + p, /* final mount point */ + u, /* temporary workspace to overmount */ + true, /* reuse the workspace if it is already a mount */ + false, /* it's OK to fall back to a plain directory if we can't mount anything */ + uid, + gid); + if (r < 0) + return r; + + } else if (r == 0) { + + /* We managed to set up a mount namespace, and are now in a child. That's great. In this case + * we can use the same directory for all cases, after turning off propagation. Question + * though is: where do we turn off propagation exactly, and where do we place the workspace + * directory? We need some place that is guaranteed to be a mount point in the host, and + * which is guaranteed to have a subdir we can mount over. /run/ is not suitable for this, + * since we ultimately want to move the resulting file system there, i.e. we need propagation + * for /run/ eventually. We could use our own /run/systemd/bind mount on itself, but that + * would be visible in the host mount table all the time, which we want to avoid. Hence, what + * we do here instead we use /dev/ and /dev/shm/ for our purposes. We know for sure that + * /dev/ is a mount point and we now for sure that /dev/shm/ exists. Hence we can turn off + * propagation on the former, and then overmount the latter. + * + * Yes it's nasty playing games with /dev/ and /dev/shm/ like this, since it does not exist + * for this purpose, but there are few other candidates that work equally well for us, and + * given that we do this in a privately namespaced short-lived single-threaded process that + * no one else sees this should be OK to do. */ + + /* Turn off propagation from our namespace to host */ + r = mount_nofollow_verbose(LOG_DEBUG, NULL, "/dev", NULL, MS_SLAVE|MS_REC, NULL); + if (r < 0) + goto child_fail; + + r = setup_credentials_internal( + context, + cgroup_context, + params, + unit, + p, /* final mount point */ + "/dev/shm", /* temporary workspace to overmount */ + false, /* do not reuse /dev/shm if it is already a mount, under no circumstances */ + true, /* insist that something is mounted, do not allow fallback to plain directory */ + uid, + gid); + if (r < 0) + goto child_fail; + + _exit(EXIT_SUCCESS); + + child_fail: + _exit(EXIT_FAILURE); + } /* If the credentials dir is empty and not a mount point, then there's no point in having it. Let's * try to remove it. This matters in particular if we created the dir as mount point but then didn't * actually end up mounting anything on it. In that case we'd rather have ENOENT than EACCESS being * seen by users when trying access this inode. */ (void) rmdir(p); - return r; + return 0; } diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index fe836de6c0c..fed72be5b76 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -915,7 +915,7 @@ static int get_fixed_group( assert(group_or_gid); assert(ret_groupname); - r = get_group_creds(&group_or_gid, ret_gid, /* flags= */ 0); + r = get_group_creds(&group_or_gid, ret_gid, /* flags = */ 0); if (r < 0) return r; @@ -993,7 +993,7 @@ static int get_supplementary_groups( return -E2BIG; const char *g = *i; - r = get_group_creds(&g, l_gids + k, /* flags= */ 0); + r = get_group_creds(&g, l_gids + k, /* flags = */ 0); if (r < 0) return r; @@ -2114,7 +2114,7 @@ static int build_environment( if (!username && !c->dynamic_user && p->runtime_scope == RUNTIME_SCOPE_SYSTEM) { assert(!c->user); - r = get_fixed_user("root", /* prefer_nss= */ false, &username, NULL, NULL, &home, &shell); + r = get_fixed_user("root", /* prefer_nss = */ false, &username, NULL, NULL, &home, &shell); if (r < 0) { log_debug_errno(r, "Failed to determine credentials for user root: %s", STRERROR_USER(r)); @@ -2347,28 +2347,28 @@ static int bpffs_helper(const ExecContext *c, int socket_fd) { assert(c); assert(socket_fd >= 0); - _cleanup_close_ int fs_fd = receive_one_fd(socket_fd, /* flags= */ 0); + _cleanup_close_ int fs_fd = receive_one_fd(socket_fd, /* flags = */ 0); if (fs_fd < 0) return log_debug_errno(fs_fd, "Failed to receive file descriptor from parent: %m"); char number[STRLEN("0x") + sizeof(c->bpf_delegate_commands) * 2 + 1]; xsprintf(number, "0x%"PRIx64, c->bpf_delegate_commands); - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_cmds", number, /* aux= */ 0) < 0) + if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_cmds", number, /* aux = */ 0) < 0) return log_debug_errno(errno, "Failed to FSCONFIG_SET_STRING: %m"); xsprintf(number, "0x%"PRIx64, c->bpf_delegate_maps); - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_maps", number, /* aux= */ 0) < 0) + if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_maps", number, /* aux = */ 0) < 0) return log_debug_errno(errno, "Failed to FSCONFIG_SET_STRING: %m"); xsprintf(number, "0x%"PRIx64, c->bpf_delegate_programs); - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_progs", number, /* aux= */ 0) < 0) + if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_progs", number, /* aux = */ 0) < 0) return log_debug_errno(errno, "Failed to FSCONFIG_SET_STRING: %m"); xsprintf(number, "0x%"PRIx64, c->bpf_delegate_attachments); - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_attachs", number, /* aux= */ 0) < 0) + if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "delegate_attachs", number, /* aux = */ 0) < 0) return log_debug_errno(errno, "Failed to FSCONFIG_SET_STRING: %m"); - if (fsconfig(fs_fd, FSCONFIG_CMD_CREATE, /* key= */ NULL, /* value= */ NULL, /* aux= */ 0) < 0) + if (fsconfig(fs_fd, FSCONFIG_CMD_CREATE, /* key = */ NULL, /* value = */ NULL, /* aux = */ 0) < 0) return log_debug_errno(errno, "Failed to create bpffs superblock: %m"); return 0; @@ -2604,7 +2604,7 @@ static int can_mount_proc(void) { if (n != 0) /* on success we should have read 0 bytes */ return -EIO; - r = wait_for_terminate_and_check("(sd-proc-check)", TAKE_PID(pid), /* flags= */ 0); + r = wait_for_terminate_and_check("(sd-proc-check)", TAKE_PID(pid), 0 /* flags= */); if (r < 0) return log_debug_errno(r, "Failed to wait for (sd-proc-check) child process to terminate: %m"); if (r != EXIT_SUCCESS) /* If something strange happened with the child, let's consider this fatal, too */ @@ -2647,8 +2647,8 @@ static int setup_private_pids(const ExecContext *c, ExecParameters *p) { p->pidref_transport_fd, pidref.fd, &IOVEC_MAKE(&pidref.pid, sizeof(pidref.pid)), - /* iovlen= */ 1, - /* flags= */ 0); + /*iovlen=*/ 1, + /*flags=*/ 0); /* Send error code to child process. */ (void) write(errno_pipe[1], &q, sizeof(q)); /* Exit here so we only go through the destructors in exec_invoke only once - in the child - as @@ -2725,7 +2725,7 @@ static int set_exec_storage_quota(int fd, uint32_t proj_id, const QuotaLimit *ql return -errno; uint32_t xattr_flags = 0; - r = read_fs_xattr_fd(fd_parent, &xattr_flags, /* ret_projid= */ NULL); + r = read_fs_xattr_fd(fd_parent, &xattr_flags, /* ret_projid = */ NULL); if (r < 0) return r; /* Refuse if parent has FS_XFLAG_PROJINHERIT since this will mean the total number of blocks will not @@ -2815,7 +2815,7 @@ static int apply_exec_quotas( /* Get the project ID of the current directory */ uint32_t proj_id; - r = read_fs_xattr_fd(fd, /* ret_xflags= */ NULL, &proj_id); + r = read_fs_xattr_fd(fd, /* ret_xflags = */ NULL, &proj_id); if (ERRNO_IS_NEG_IOCTL_NOT_SUPPORTED(r)) { log_debug_errno(r, "Not applying storage quotas. FS_IOC_FSGETXATTR not supported for %s: %m", target_dir); return 0; @@ -4988,7 +4988,7 @@ static int setup_term_environment(const ExecContext *context, char ***env) { if (!key) return -ENOMEM; - r = proc_cmdline_get_key(key, /* flags= */ 0, &cmdline); + r = proc_cmdline_get_key(key, /* flags = */ 0, &cmdline); if (r > 0) return strv_env_assign(env, "TERM", cmdline); if (r < 0) @@ -5292,7 +5292,7 @@ int exec_invoke( * or PAM shall be invoked, let's consult NSS even for root, so that the user * gets accurate $SHELL in session(-like) contexts. */ r = get_fixed_user(u, - /* prefer_nss= */ context->set_login_environment > 0 || context->pam_name, + /* prefer_nss = */ context->set_login_environment > 0 || context->pam_name, &username, &uid, &gid, &pwent_home, &shell); if (r < 0) { *exit_status = EXIT_USER; diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index a634b0308ed..9671899796f 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -3701,7 +3701,7 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { _cleanup_free_ void *d = NULL; size_t size; - r = unbase64mem_full(data, SIZE_MAX, /* secure= */ true, &d, &size); + r = unbase64mem_full(data, SIZE_MAX, /* secure = */ true, &d, &size); if (r < 0) return r; diff --git a/src/core/execute.c b/src/core/execute.c index a5cb664d612..116496b91b8 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -918,7 +918,7 @@ static int exec_context_load_environment(const Unit *unit, const ExecContext *c, } /* Filename supports globbing, take all matching files */ - r = safe_glob(fn, /* flags= */ 0, &paths); + r = safe_glob(fn, /* flags = */ 0, &paths); if (r < 0) { if (ignore) continue; @@ -2260,7 +2260,7 @@ int exec_command_append(ExecCommand *c, const char *path, ...) { if (!l) return -ENOMEM; - r = strv_extend_strv_consume(&c->argv, l, /* filter_duplicates= */ false); + r = strv_extend_strv_consume(&c->argv, l, /* filter_duplicates = */ false); if (r < 0) return r; diff --git a/src/core/import-creds.c b/src/core/import-creds.c index 89f0c557078..8e77bd09f67 100644 --- a/src/core/import-creds.c +++ b/src/core/import-creds.c @@ -103,7 +103,7 @@ static int acquire_credential_directory(ImportCredentialsContext *c, const char (void) mount_nofollow_verbose(LOG_WARNING, NULL, path, NULL, MS_BIND|MS_REMOUNT|credentials_fs_mount_flags(/* ro= */ false), NULL); else if (with_mount) /* If not a mount point yet, and the credentials are not encrypted, then let's try to mount a no-swap fs there */ - (void) mount_credentials_fs(path); + (void) mount_credentials_fs(path, CREDENTIALS_TOTAL_SIZE_MAX, /* ro= */ false); c->target_dir_fd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC); if (c->target_dir_fd < 0) @@ -532,7 +532,7 @@ static int parse_smbios_strings(ImportCredentialsContext *c, const char *data, s /* Optionally base64 decode the data, if requested, to allow binary credentials */ if (unbase64) { - r = unbase64mem_full(eq + 1, nul - (eq + 1), /* secure= */ false, &buf, &buflen); + r = unbase64mem_full(eq + 1, nul - (eq + 1), /* secure = */ false, &buf, &buflen); if (r < 0) { log_warning_errno(r, "Failed to base64 decode credential '%s', ignoring: %m", cn); continue; diff --git a/src/core/job.c b/src/core/job.c index 449afc12512..5e53512c9da 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -406,13 +406,13 @@ void job_dump(Job *j, FILE *f, const char *prefix) { * be merged with C either. */ static const JobType job_merging_table[] = { -/* What \ With * JOB_START JOB_VERIFY_ACTIVE JOB_STOP JOB_RELOAD */ +/* What \ With * JOB_START JOB_VERIFY_ACTIVE JOB_STOP JOB_RELOAD */ /*********************************************************************************/ -/* JOB_START */ -/* JOB_VERIFY_ACTIVE */ JOB_START, -/* JOB_STOP */ -1, -1, -/* JOB_RELOAD */ JOB_RELOAD_OR_START, JOB_RELOAD, -1, -/* JOB_RESTART */ JOB_RESTART, JOB_RESTART, -1, JOB_RESTART, +/*JOB_START */ +/*JOB_VERIFY_ACTIVE */ JOB_START, +/*JOB_STOP */ -1, -1, +/*JOB_RELOAD */ JOB_RELOAD_OR_START, JOB_RELOAD, -1, +/*JOB_RESTART */ JOB_RESTART, JOB_RESTART, -1, JOB_RESTART, }; JobType job_type_lookup_merge(JobType a, JobType b) { diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c index 5a86fed9207..c9d7b9338e1 100644 --- a/src/core/load-dropin.c +++ b/src/core/load-dropin.c @@ -126,11 +126,11 @@ int unit_load_dropin(Unit *u) { return r; /* Load .conf dropins */ - r = unit_find_dropin_paths(u, /* use_unit_path_cache= */ true, &l); + r = unit_find_dropin_paths(u, /* use_unit_path_cache = */ true, &l); if (r <= 0) return 0; - r = strv_extend_strv_consume(&u->dropin_paths, TAKE_PTR(l), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(&u->dropin_paths, TAKE_PTR(l), /* filter_duplicates = */ true); if (r < 0) return log_oom(); diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 0954631cad2..6e5fb6afc42 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1015,7 +1015,7 @@ int config_parse_exec( /* Check explicitly for an unquoted semicolon as command separator token. */ if (p[0] == ';' && (!p[1] || strchr(WHITESPACE, p[1]))) { p++; - p = skip_leading_chars(p, /* bad= */ NULL); + p = skip_leading_chars(p, /* bad = */ NULL); semicolon = true; break; } @@ -1024,7 +1024,7 @@ int config_parse_exec( * extract_first_word() would return the same for all of those. */ if (p[0] == '\\' && p[1] == ';' && (!p[2] || strchr(WHITESPACE, p[2]))) { p += 2; - p = skip_leading_chars(p, /* bad= */ NULL); + p = skip_leading_chars(p, /* bad = */ NULL); if (strv_extend(&args, ";") < 0) return log_oom(); @@ -2817,7 +2817,7 @@ int config_parse_pass_environ( return log_oom(); } - r = strv_extend_strv_consume(passenv, TAKE_PTR(n), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(passenv, TAKE_PTR(n), /* filter_duplicates = */ true); if (r < 0) return log_oom(); @@ -2886,7 +2886,7 @@ int config_parse_unset_environ( return log_oom(); } - r = strv_extend_strv_consume(unsetenv, TAKE_PTR(n), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(unsetenv, TAKE_PTR(n), /* filter_duplicates = */ true); if (r < 0) return log_oom(); @@ -4678,7 +4678,7 @@ int config_parse_set_credential( size_t size; if (encrypted) { - r = unbase64mem_full(p, SIZE_MAX, /* secure= */ true, &d, &size); + r = unbase64mem_full(p, SIZE_MAX, /* secure = */ true, &d, &size); if (r == -ENOMEM) return log_oom(); if (r < 0) { @@ -6631,7 +6631,7 @@ int config_parse_protect_hostname( return 0; } - if (!hostname_is_valid(h, /* flags= */ 0)) + if (!hostname_is_valid(h, /* flags = */ 0)) return log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid hostname is specified to %s=, ignoring: %s", lvalue, h); diff --git a/src/core/main.c b/src/core/main.c index 61a5a23d2f8..cab8e009411 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -841,7 +841,7 @@ static int parse_config_file(void) { (const char* const*) files, (const char* const*) dirs, "user.conf.d", - /* root= */ NULL, + /* root = */ NULL, "Manager\0", config_item_table_lookup, items, CONFIG_PARSE_WARN, @@ -1427,7 +1427,7 @@ static int os_release_status(void) { } } - if (support_end && os_release_support_ended(support_end, /* quiet= */ false, /* ret_eol= */ NULL) > 0) + if (support_end && os_release_support_ended(support_end, /* quiet = */ false, /* ret_eol = */ NULL) > 0) /* pretty_name may include the version already, so we'll print the version only if we * have it and we're not using pretty_name. */ status_printf(ANSI_HIGHLIGHT_RED " !! " ANSI_NORMAL, 0, @@ -1998,19 +1998,19 @@ static int do_reexecute( /* If we're supposed to switch root, preemptively check the existence of a usable init. * Otherwise the system might end up in a completely undebuggable state afterwards. */ if (switch_root_init) { - r = chase_and_access(switch_root_init, switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path= */ NULL); + r = chase_and_access(switch_root_init, switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path = */ NULL); if (r < 0) log_warning_errno(r, "Failed to chase configured init %s/%s: %m", switch_root_dir, switch_root_init); } else { - r = chase_and_access(SYSTEMD_BINARY_PATH, switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path= */ NULL); + r = chase_and_access(SYSTEMD_BINARY_PATH, switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path = */ NULL); if (r < 0) log_debug_errno(r, "Failed to chase our own binary %s/%s: %m", switch_root_dir, SYSTEMD_BINARY_PATH); } if (r < 0) { - r = chase_and_access("/sbin/init", switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path= */ NULL); + r = chase_and_access("/sbin/init", switch_root_dir, CHASE_PREFIX_ROOT, X_OK, /* ret_path = */ NULL); if (r < 0) { *ret_error_message = "Switch root target contains no usable init"; return log_error_errno(r, "Failed to chase %s/sbin/init", switch_root_dir); @@ -2355,7 +2355,7 @@ static void log_execution_mode(bool *ret_first_boot) { /* Let's check whether we are in first boot. First, check if an override was * specified on the kernel command line. If yes, we honour that. */ - r = proc_cmdline_get_bool("systemd.condition_first_boot", /* flags= */ 0, &first_boot); + r = proc_cmdline_get_bool("systemd.condition_first_boot", /* flags = */ 0, &first_boot); if (r < 0) log_debug_errno(r, "Failed to parse systemd.condition_first_boot= kernel command line argument, ignoring: %m"); @@ -2447,7 +2447,7 @@ static int initialize_runtime( if (!skip_setup) { /* Check that /usr/ is either on the same file system as / or mounted already. */ - if (dir_is_empty("/usr", /* ignore_hidden_or_backup= */ true) > 0) { + if (dir_is_empty("/usr", /* ignore_hidden_or_backup = */ true) > 0) { *ret_error_message = "Refusing to run in unsupported environment where /usr/ is not populated"; return -ENOEXEC; } @@ -2458,11 +2458,11 @@ static int initialize_runtime( (void) import_credentials(); (void) os_release_status(); - (void) machine_id_setup(/* root= */ NULL, arg_machine_id, + (void) machine_id_setup(/* root = */ NULL, arg_machine_id, (first_boot ? MACHINE_ID_SETUP_FORCE_TRANSIENT : 0) | (arg_machine_id_from_firmware ? MACHINE_ID_SETUP_FORCE_FIRMWARE : 0), - /* ret= */ NULL); - (void) hostname_setup(/* really= */ true); + /* ret = */ NULL); + (void) hostname_setup(/* really = */ true); (void) loopback_setup(); bump_unix_max_dgram_qlen(); diff --git a/src/core/manager.c b/src/core/manager.c index 7938c989af1..c1c2b713ecc 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1005,7 +1005,7 @@ int manager_new(RuntimeScope runtime_scope, ManagerTestRunFlags test_run_flags, return r; #if HAVE_LIBBPF - if (MANAGER_IS_SYSTEM(m) && bpf_restrict_fs_supported(/* initialize= */ true)) { + if (MANAGER_IS_SYSTEM(m) && bpf_restrict_fs_supported(/* initialize = */ true)) { r = bpf_restrict_fs_setup(m); if (r < 0) log_warning_errno(r, "Failed to setup LSM BPF, ignoring: %m"); @@ -1510,7 +1510,7 @@ static unsigned manager_dispatch_stop_when_unneeded_queue(Manager *m) { } /* Ok, nobody needs us anymore. Sniff. Then let's commit suicide */ - r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, &error, /* ret = */ NULL); if (r < 0) log_unit_warning_errno(u, r, "Failed to enqueue stop job, ignoring: %s", bus_error_message(&error, r)); } @@ -1551,7 +1551,7 @@ static unsigned manager_dispatch_start_when_upheld_queue(Manager *m) { continue; } - r = manager_add_job(u->manager, JOB_START, u, JOB_FAIL, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_START, u, JOB_FAIL, &error, /* ret = */ NULL); if (r < 0) log_unit_warning_errno(u, r, "Failed to enqueue start job, ignoring: %s", bus_error_message(&error, r)); } @@ -1592,7 +1592,7 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) { continue; } - r = manager_add_job(u->manager, JOB_STOP, u, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_STOP, u, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) log_unit_warning_errno(u, r, "Failed to enqueue stop job, ignoring: %s", bus_error_message(&error, r)); } @@ -1944,9 +1944,9 @@ static void manager_preset_all(Manager *m) { CLEANUP_ARRAY(changes, n_changes, install_changes_free); log_info("Applying preset policy."); - r = unit_file_preset_all(RUNTIME_SCOPE_SYSTEM, /* file_flags= */ 0, - /* root_dir= */ NULL, mode, &changes, &n_changes); - install_changes_dump(r, "preset", changes, n_changes, /* quiet= */ false); + r = unit_file_preset_all(RUNTIME_SCOPE_SYSTEM, /* file_flags = */ 0, + /* root_dir = */ NULL, mode, &changes, &n_changes); + install_changes_dump(r, "preset", changes, n_changes, /* quiet = */ false); if (r < 0) log_full_errno(r == -EEXIST ? LOG_NOTICE : LOG_WARNING, r, "Failed to populate /etc with preset unit settings, ignoring: %m"); @@ -2232,7 +2232,7 @@ int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode return r; assert(unit); - return manager_add_job_full(m, type, unit, mode, /* extra_flags= */ 0, affected_jobs, e, ret); + return manager_add_job_full(m, type, unit, mode, /* extra_flags = */ 0, affected_jobs, e, ret); } int manager_add_job_by_name_and_warn(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, Job **ret) { @@ -3924,7 +3924,7 @@ void manager_send_reloading(Manager *m) { assert(m); /* Let whoever invoked us know that we are now reloading */ - (void) notify_reloading_full(/* status= */ NULL); + (void) notify_reloading_full(/* status = */ NULL); /* And ensure that we'll send READY=1 again as soon as we are ready again */ m->ready_sent = false; diff --git a/src/core/mount.c b/src/core/mount.c index 833ab762cb5..c2bc2106169 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -665,7 +665,7 @@ static int mount_load(Unit *u) { bool from_kernel = m->from_proc_self_mountinfo || u->perpetual; - r = unit_load_fragment_and_dropin(u, /* fragment_required= */ !from_kernel); + r = unit_load_fragment_and_dropin(u, /* fragment_required = */ !from_kernel); /* Add in some extras. Note we do this in all cases (even if we failed to load the unit) when announced by the * kernel, because we need some things to be set up no matter what when the kernel establishes a mount and thus @@ -764,7 +764,7 @@ static void mount_catchup(Unit *u) { break; case MOUNT_MOUNTED: assert(!pidref_is_set(&m->control_pid)); - mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result = */ false); break; default: ; @@ -897,13 +897,13 @@ static void mount_enter_dead(Mount *m, MountResult f, bool flush_result) { m->result = f; unit_log_result(UNIT(m), m->result == MOUNT_SUCCESS, mount_result_to_string(m->result)); - unit_warn_leftover_processes(UNIT(m), /* start= */ false); + unit_warn_leftover_processes(UNIT(m), /* start = */ false); mount_set_state(m, m->result != MOUNT_SUCCESS ? MOUNT_FAILED : MOUNT_DEAD); m->exec_runtime = exec_runtime_destroy(m->exec_runtime); - unit_destroy_runtime_data(UNIT(m), &m->exec_context, /* destroy_runtime_dir= */ true); + unit_destroy_runtime_data(UNIT(m), &m->exec_context, /* destroy_runtime_dir = */ true); unit_unref_uid_gid(UNIT(m), true); @@ -924,7 +924,7 @@ static void mount_enter_mounted(Mount *m, MountResult f) { * * Note that this effectively means fresh creds are used during remount, but that's mostly what * users would expect anyways. */ - unit_destroy_runtime_data(UNIT(m), &m->exec_context, /* destroy_runtime_dir= */ false); + unit_destroy_runtime_data(UNIT(m), &m->exec_context, /* destroy_runtime_dir = */ false); mount_set_state(m, MOUNT_MOUNTED); } @@ -992,12 +992,12 @@ static void mount_enter_signal(Mount *m, MountState state, MountResult f) { else if (state == MOUNT_UNMOUNTING_SIGTERM && m->kill_context.send_sigkill) mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, MOUNT_SUCCESS); else - mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result = */ false); return; fail: - mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result = */ false); } static int mount_set_umount_command(Mount *m, ExecCommand *c) { @@ -1058,7 +1058,7 @@ static void mount_enter_unmounting(Mount *m) { return; fail: - mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result = */ false); } static int mount_apply_graceful_options(Mount *m, const MountParameters *p, char **opts) { @@ -1188,7 +1188,7 @@ static void mount_enter_mounting(Mount *m) { bool source_is_dir = true; if (mount_is_bind(p)) { - r = is_dir(p->what, /* follow= */ true); + r = is_dir(p->what, /* follow = */ true); if (r < 0 && r != -ENOENT) log_unit_info_errno(UNIT(m), r, "Failed to determine type of bind mount source '%s', ignoring: %m", p->what); else if (r == 0) @@ -1248,12 +1248,12 @@ static void mount_enter_mounting(Mount *m) { } mount_unwatch_control_pid(m); - unit_warn_leftover_processes(UNIT(m), /* start= */ true); + unit_warn_leftover_processes(UNIT(m), /* start = */ true); m->control_command_id = MOUNT_EXEC_MOUNT; m->control_command = m->exec_command + MOUNT_EXEC_MOUNT; - r = mount_set_mount_command(m, m->control_command, p, /* remount= */ false); + r = mount_set_mount_command(m, m->control_command, p, /* remount = */ false); if (r < 0) { log_unit_error_errno(UNIT(m), r, "Failed to prepare mount command line: %m"); goto fail; @@ -1269,7 +1269,7 @@ static void mount_enter_mounting(Mount *m) { return; fail: - mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_FAILURE_RESOURCES, /* flush_result = */ false); } static void mount_set_reload_result(Mount *m, MountResult result) { @@ -1300,7 +1300,7 @@ static void mount_enter_remounting(Mount *m) { m->control_command_id = MOUNT_EXEC_REMOUNT; m->control_command = m->exec_command + MOUNT_EXEC_REMOUNT; - r = mount_set_mount_command(m, m->control_command, p, /* remount= */ true); + r = mount_set_mount_command(m, m->control_command, p, /* remount = */ true); if (r < 0) { log_unit_error_errno(UNIT(m), r, "Failed to prepare remount command line: %m"); goto fail; @@ -1317,7 +1317,7 @@ static void mount_enter_remounting(Mount *m) { fail: mount_set_reload_result(m, MOUNT_FAILURE_RESOURCES); - mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result = */ false); } static void mount_cycle_clear(Mount *m) { @@ -1582,7 +1582,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { log_unit_warning(UNIT(m), "Mount process finished, but there is no mount."); f = MOUNT_FAILURE_PROTOCOL; } - mount_enter_dead(m, f, /* flush_result= */ false); + mount_enter_dead(m, f, /* flush_result = */ false); break; case MOUNT_MOUNTING_DONE: @@ -1592,7 +1592,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { case MOUNT_REMOUNTING: case MOUNT_REMOUNTING_SIGTERM: case MOUNT_REMOUNTING_SIGKILL: - mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result = */ false); break; case MOUNT_UNMOUNTING: @@ -1613,27 +1613,27 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { /* Hmm, umount process spawned by us failed, but the mount disappeared anyway? * Maybe someone else is trying to unmount at the same time. */ log_unit_notice(u, "Mount disappeared even though umount process failed, continuing."); - mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result= */ true); + mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result = */ true); } else /* At this point, either the unmount succeeded or unexpected error occurred. We usually * remember the first error in 'result', but here let's update that forcibly, since * there could previous failed attempts yet we only care about the most recent * attempt. IOW, if we eventually managed to unmount the stuff, don't enter failed * end state. */ - mount_enter_dead_or_mounted(m, f, /* flush_result= */ true); + mount_enter_dead_or_mounted(m, f, /* flush_result = */ true); break; case MOUNT_UNMOUNTING_SIGTERM: case MOUNT_UNMOUNTING_SIGKILL: - mount_enter_dead_or_mounted(m, f, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, f, /* flush_result = */ false); break; case MOUNT_CLEANING: if (m->clean_result == MOUNT_SUCCESS) m->clean_result = f; - mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result = */ false); break; default: @@ -1671,7 +1671,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user mount_enter_signal(m, MOUNT_REMOUNTING_SIGKILL, MOUNT_SUCCESS); } else { log_unit_warning(UNIT(m), "Remounting timed out. Skipping SIGKILL. Ignoring."); - mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result = */ false); } break; @@ -1679,7 +1679,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user mount_set_reload_result(m, MOUNT_FAILURE_TIMEOUT); log_unit_warning(UNIT(m), "Mount process still around after SIGKILL. Ignoring."); - mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_SUCCESS, /* flush_result = */ false); break; case MOUNT_UNMOUNTING: @@ -1693,13 +1693,13 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, MOUNT_FAILURE_TIMEOUT); } else { log_unit_warning(UNIT(m), "Mount process timed out. Skipping SIGKILL. Ignoring."); - mount_enter_dead_or_mounted(m, MOUNT_FAILURE_TIMEOUT, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_FAILURE_TIMEOUT, /* flush_result = */ false); } break; case MOUNT_UNMOUNTING_SIGKILL: log_unit_warning(UNIT(m), "Mount process still around after SIGKILL. Ignoring."); - mount_enter_dead_or_mounted(m, MOUNT_FAILURE_TIMEOUT, /* flush_result= */ false); + mount_enter_dead_or_mounted(m, MOUNT_FAILURE_TIMEOUT, /* flush_result = */ false); break; case MOUNT_CLEANING: @@ -2238,7 +2238,7 @@ static int mount_process_proc_self_mountinfo(Manager *m) { * Also explicitly override the result (see the comment in mount_sigchld_event()), * but more aggressively here since the state change is extrinsic. */ mount_cycle_clear(mount); - mount_enter_dead(mount, MOUNT_SUCCESS, /* flush_result= */ true); + mount_enter_dead(mount, MOUNT_SUCCESS, /* flush_result = */ true); break; case MOUNT_MOUNTING_DONE: @@ -2395,7 +2395,7 @@ static int mount_test_startable(Unit *u) { r = unit_test_start_limit(u); if (r < 0) { - mount_enter_dead(m, MOUNT_FAILURE_START_LIMIT_HIT, /* flush_result= */ false); + mount_enter_dead(m, MOUNT_FAILURE_START_LIMIT_HIT, /* flush_result = */ false); return r; } diff --git a/src/core/namespace.c b/src/core/namespace.c index 19bf2903363..dd9ab123243 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -1475,7 +1475,7 @@ static int mount_private_apivfs( /* We lack permissions to mount a new instance, and it is not already mounted. But we can * access the host's, so as a final fallback bind-mount it to the destination, as most likely * we are inside a user manager in an unprivileged user namespace. */ - r = mount_nofollow_verbose(LOG_DEBUG, bind_source, entry_path, /* fstype= */ NULL, MS_BIND|MS_REC, /* options= */ NULL); + r = mount_nofollow_verbose(LOG_DEBUG, bind_source, entry_path, /* fstype = */ NULL, MS_BIND|MS_REC, /* options = */ NULL); if (r < 0) return r; @@ -1485,12 +1485,12 @@ static int mount_private_apivfs( return r; /* OK. We have a new mount instance. Let's clear an existing mount and its submounts. */ - r = umount_recursive(entry_path, /* flags= */ 0); + r = umount_recursive(entry_path, /* flags = */ 0); if (r < 0) log_debug_errno(r, "Failed to unmount directories below '%s', ignoring: %m", entry_path); /* Then, move the new mount instance. */ - r = mount_nofollow_verbose(LOG_DEBUG, temporary_mount, entry_path, /* fstype= */ NULL, MS_MOVE, /* options= */ NULL); + r = mount_nofollow_verbose(LOG_DEBUG, temporary_mount, entry_path, /* fstype = */ NULL, MS_MOVE, /* options = */ NULL); if (r < 0) return r; @@ -1503,13 +1503,13 @@ static int mount_private_apivfs( static int mount_private_sysfs(const MountEntry *m, const NamespaceParameters *p) { assert(m); assert(p); - return mount_private_apivfs("sysfs", mount_entry_path(m), "/sys", /* opts= */ NULL, p->runtime_scope); + return mount_private_apivfs("sysfs", mount_entry_path(m), "/sys", /* opts = */ NULL, p->runtime_scope); } static int mount_private_cgroup2fs(const MountEntry *m, const NamespaceParameters *p) { assert(m); assert(p); - return mount_private_apivfs("cgroup2", mount_entry_path(m), "/sys/fs/cgroup", /* opts= */ NULL, p->runtime_scope); + return mount_private_apivfs("cgroup2", mount_entry_path(m), "/sys/fs/cgroup", /* opts = */ NULL, p->runtime_scope); } static int mount_procfs(const MountEntry *m, const NamespaceParameters *p) { @@ -1744,11 +1744,11 @@ static int mount_bpffs(const MountEntry *m, PidRef *pidref, int socket_fd, int e if (fs_fd < 0) return log_debug_errno(errno, "Failed to fsopen: %m"); - r = send_one_fd(socket_fd, fs_fd, /* flags= */ 0); + r = send_one_fd(socket_fd, fs_fd, /* flags = */ 0); if (r < 0) return log_debug_errno(r, "Failed to send bpffs fd to child: %m"); - r = pidref_wait_for_terminate_and_check("(sd-bpffs)", pidref, /* flags= */ 0); + r = pidref_wait_for_terminate_and_check("(sd-bpffs)", pidref, /* flags = */ 0); if (r < 0) return r; @@ -1764,7 +1764,7 @@ static int mount_bpffs(const MountEntry *m, PidRef *pidref, int socket_fd, int e pidref_done(pidref); - _cleanup_close_ int mnt_fd = fsmount(fs_fd, /* flags= */ 0, /* mount_attrs= */ 0); + _cleanup_close_ int mnt_fd = fsmount(fs_fd, /* flags = */ 0, /* mount_attrs = */ 0); if (mnt_fd < 0) return log_debug_errno(errno, "Failed to fsmount bpffs: %m"); @@ -1887,7 +1887,7 @@ static int apply_one_mount( case MOUNT_READ_WRITE_IMPLICIT: case MOUNT_EXEC: case MOUNT_NOEXEC: - r = path_is_mount_point_full(mount_entry_path(m), root_directory, /* flags= */ 0); + r = path_is_mount_point_full(mount_entry_path(m), root_directory, /* flags = */ 0); if (r == -ENOENT && m->ignore) return 0; if (r < 0) @@ -1953,7 +1953,7 @@ static int apply_one_mount( host_os_release_id_like, host_os_release_version_id, host_os_release_level, - /* host_extension_scope= */ NULL, /* Leave empty, we need to accept both system and portable */ + /* host_extension_scope = */ NULL, /* Leave empty, we need to accept both system and portable */ extension_release, class); if (r < 0) @@ -2752,7 +2752,7 @@ int setup_namespace(const NamespaceParameters *p, char **reterr_path) { if (r < 0) return r; - r = append_private_bpf(&ml, p->private_bpf, p->protect_kernel_tunables, /* ignore_protect= */ false, p); + r = append_private_bpf(&ml, p->private_bpf, p->protect_kernel_tunables, /* ignore_protect = */ false, p); if (r < 0) return r; @@ -2996,7 +2996,7 @@ int setup_namespace(const NamespaceParameters *p, char **reterr_path) { } else if (p->root_directory) { /* A root directory is specified. Turn its directory into bind mount, if it isn't one yet. */ - r = path_is_mount_point_full(root, /* root= */ NULL, AT_SYMLINK_FOLLOW); + r = path_is_mount_point_full(root, /* root = */ NULL, AT_SYMLINK_FOLLOW); if (r < 0) return log_debug_errno(r, "Failed to detect that %s is a mount point or not: %m", root); if (r == 0) { @@ -3022,7 +3022,7 @@ int setup_namespace(const NamespaceParameters *p, char **reterr_path) { return r; /* MS_MOVE does not work on MS_SHARED so the remount MS_SHARED will be done later */ - r = mount_switch_root(root, /* mount_propagation_flag= */ 0); + r = mount_switch_root(root, /* mount_propagation_flag = */ 0); if (r == -EINVAL && p->root_directory) { /* If we are using root_directory and we don't have privileges (ie: user manager in a user * namespace) and the root_directory is already a mount point in the parent namespace, @@ -3032,7 +3032,7 @@ int setup_namespace(const NamespaceParameters *p, char **reterr_path) { r = mount_nofollow_verbose(LOG_DEBUG, root, root, NULL, MS_BIND|MS_REC, NULL); if (r < 0) return r; - r = mount_switch_root(root, /* mount_propagation_flag= */ 0); + r = mount_switch_root(root, /* mount_propagation_flag = */ 0); } if (r < 0) return log_debug_errno(r, "Failed to mount root with MS_MOVE: %m"); @@ -4066,7 +4066,7 @@ int bpf_delegate_from_string(const char *s, uint64_t *ret, uint64_t (*parser)(co for (;;) { _cleanup_free_ char *word = NULL; - r = extract_first_word(&s, &word, ",", /* flags= */ 0); + r = extract_first_word(&s, &word, ",", /* flags = */ 0); if (r < 0) return log_warning_errno(r, "Failed to parse delegate options \"%s\": %m", s); if (r == 0) diff --git a/src/core/path.c b/src/core/path.c index 74218dd6be5..530db117b48 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -478,7 +478,7 @@ static void path_set_state(Path *p, PathState state) { if (state != old_state) log_unit_debug(UNIT(p), "Changed %s -> %s", path_state_to_string(old_state), path_state_to_string(state)); - unit_notify(UNIT(p), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(p), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static void path_enter_waiting(Path *p, bool initial, bool from_trigger_notify); @@ -816,7 +816,7 @@ static int path_trigger_notify_on_defer(sd_event_source *s, void *userdata) { return 0; } - path_trigger_notify_impl(UNIT(p), trigger, /* on_defer= */ true); + path_trigger_notify_impl(UNIT(p), trigger, /* on_defer = */ true); return 0; } @@ -857,7 +857,7 @@ static void path_trigger_notify_impl(Unit *u, Unit *other, bool on_defer) { return; if (on_defer) { - path_enter_waiting(p, /* initial= */ false, /* from_trigger_notify= */ true); + path_enter_waiting(p, /* initial = */ false, /* from_trigger_notify = */ true); return; } @@ -886,7 +886,7 @@ static void path_trigger_notify_impl(Unit *u, Unit *other, bool on_defer) { } static void path_trigger_notify(Unit *u, Unit *other) { - path_trigger_notify_impl(u, other, /* on_defer= */ false); + path_trigger_notify_impl(u, other, /* on_defer = */ false); } static void path_reset_failed(Unit *u) { diff --git a/src/core/scope.c b/src/core/scope.c index d36b27c537d..a6b4cebca5f 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -101,7 +101,7 @@ static void scope_set_state(Scope *s, ScopeState state) { log_unit_debug(UNIT(s), "Changed %s -> %s", scope_state_to_string(old_state), scope_state_to_string(state)); - unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static int scope_add_default_dependencies(Scope *s) { diff --git a/src/core/service.c b/src/core/service.c index dcc4a992ccf..249c322c2df 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1247,7 +1247,7 @@ static int service_load_pid_file(Service *s, bool may_warn) { } else log_unit_debug(UNIT(s), "Main PID loaded: "PID_FMT, pidref.pid); - r = service_set_main_pidref(s, TAKE_PIDREF(pidref), /* start_timestamp= */ NULL); + r = service_set_main_pidref(s, TAKE_PIDREF(pidref), /* start_timestamp = */ NULL); if (r < 0) return r; @@ -1277,7 +1277,7 @@ static void service_search_main_pid(Service *s) { return; log_unit_debug(UNIT(s), "Main PID guessed: "PID_FMT, pid.pid); - if (service_set_main_pidref(s, TAKE_PIDREF(pid), /* start_timestamp= */ NULL) < 0) + if (service_set_main_pidref(s, TAKE_PIDREF(pid), /* start_timestamp = */ NULL) < 0) return; r = unit_watch_pidref(UNIT(s), &s->main_pid, /* exclusive= */ false); @@ -1356,7 +1356,7 @@ static void service_set_state(Service *s, ServiceState state) { } if (start_only) - unit_destroy_runtime_data(u, &s->exec_context, /* destroy_runtime_dir= */ false); + unit_destroy_runtime_data(u, &s->exec_context, /* destroy_runtime_dir = */ false); } if (old_state != state) @@ -1774,7 +1774,7 @@ static int service_spawn_internal( &exec_params.fds, &exec_params.fd_names, &exec_params.n_socket_fds, - /* n_stashed_fds= */ NULL); + /* n_stashed_fds = */ NULL); if (r < 0) return r; @@ -1813,7 +1813,7 @@ static int service_spawn_internal( } if (MANAGER_IS_USER(UNIT(s)->manager) && - !exec_needs_pid_namespace(&s->exec_context, /* params= */ NULL)) { + !exec_needs_pid_namespace(&s->exec_context, /* params = */ NULL)) { if (asprintf(our_env + n_env++, "MANAGERPID="PID_FMT, getpid_cached()) < 0) return -ENOMEM; @@ -2131,7 +2131,7 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart) end_state = SERVICE_FAILED; restart_state = SERVICE_FAILED_BEFORE_AUTO_RESTART; } - unit_warn_leftover_processes(UNIT(s), /* start= */ false); + unit_warn_leftover_processes(UNIT(s), /* start = */ false); if (!allow_restart) log_unit_debug(UNIT(s), "Service restart not allowed."); @@ -2202,7 +2202,7 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart) s->exec_runtime = exec_runtime_destroy(s->exec_runtime); /* Also, remove the runtime directory */ - unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir= */ true); + unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir = */ true); /* Also get rid of the fd store, if that's configured. */ if (s->fd_store_preserve_mode == EXEC_PRESERVE_NO) @@ -2236,7 +2236,7 @@ static void service_enter_stop_post(Service *s, ServiceResult f) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_stop_usec, &s->control_pid); if (r < 0) { @@ -2348,7 +2348,7 @@ static void service_enter_stop(Service *s, ServiceResult f) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_stop_usec, &s->control_pid); if (r < 0) { @@ -2433,7 +2433,7 @@ static void service_enter_start_post(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_start_usec, &s->control_pid); if (r < 0) { @@ -2479,7 +2479,7 @@ static int service_adverse_to_leftover_processes(Service *s) { * instances running, lets not stress the rigor of these. Also ExecStartPre= parts of the service * aren't as rigoriously written to protect against multiple use. */ - if (unit_warn_leftover_processes(UNIT(s), /* start= */ true) > 0 && + if (unit_warn_leftover_processes(UNIT(s), /* start = */ true) > 0 && IN_SET(s->kill_context.kill_mode, KILL_MIXED, KILL_CONTROL_GROUP) && !s->kill_context.send_sigkill) return log_unit_error_errno(UNIT(s), SYNTHETIC_ERRNO(EBUSY), @@ -2603,7 +2603,7 @@ static void service_enter_start_pre(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_start_usec, &s->control_pid); if (r < 0) { @@ -2639,7 +2639,7 @@ static void service_enter_condition(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_start_usec, &s->control_pid); if (r < 0) { @@ -2684,8 +2684,8 @@ static void service_enter_restart(Service *s, bool shortcut) { JOB_START, UNIT(s), s->restart_mode == SERVICE_RESTART_MODE_DIRECT ? JOB_REPLACE : JOB_RESTART_DEPENDENCIES, TRANSACTION_REENQUEUE_ANCHOR, - /* affected_jobs= */ NULL, - &error, /* ret= */ NULL); + /* affected_jobs = */ NULL, + &error, /* ret = */ NULL); if (r < 0) { log_unit_warning(UNIT(s), "Failed to schedule restart job: %s", bus_error_message(&error, r)); return service_enter_dead(s, SERVICE_FAILURE_RESOURCES, /* allow_restart= */ false); @@ -2743,7 +2743,7 @@ static void service_enter_reload_post(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_start_usec, &s->control_pid); if (r < 0) { @@ -2818,7 +2818,7 @@ static void service_enter_reload(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), s->timeout_start_usec, &s->control_pid); if (r < 0) { @@ -2963,7 +2963,7 @@ static void service_run_next_control(Service *s) { r = service_spawn(s, s->control_command, - service_exec_flags(s->control_command_id, /* cred_flag= */ 0), + service_exec_flags(s->control_command_id, /* cred_flag = */ 0), timeout, &s->control_pid); if (r < 0) { @@ -3015,7 +3015,7 @@ static int service_start(Unit *u) { * for auto restart. We need to re-enqueue the job though, as the job type has changed * (JOB_RESTART_DEPENDENCIES). */ - service_enter_restart(s, /* shortcut= */ true); + service_enter_restart(s, /* shortcut = */ true); return -EAGAIN; } @@ -3563,7 +3563,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value, PidRef pidref; if (!pidref_is_set(&s->main_pid) && deserialize_pidref(fds, value, &pidref) >= 0) - (void) service_set_main_pidref(s, pidref, /* start_timestamp= */ NULL); + (void) service_set_main_pidref(s, pidref, /* start_timestamp = */ NULL); } else if (streq(key, "main-pid-known")) { r = parse_boolean(value); @@ -4666,7 +4666,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us log_unit_debug(UNIT(s), "Service has no hold-off time (RestartSec=0), scheduling restart."); - service_enter_restart(s, /* shortcut= */ false); + service_enter_restart(s, /* shortcut = */ false); break; case SERVICE_CLEANING: @@ -4958,7 +4958,7 @@ static void service_notify_message( log_unit_warning(u, "New main PID "PID_FMT" does not belong to service, refusing.", new_main_pid.pid); } if (r > 0) { - (void) service_set_main_pidref(s, TAKE_PIDREF(new_main_pid), /* start_timestamp= */ NULL); + (void) service_set_main_pidref(s, TAKE_PIDREF(new_main_pid), /* start_timestamp = */ NULL); r = unit_watch_pidref(UNIT(s), &s->main_pid, /* exclusive= */ false); if (r < 0) @@ -5155,7 +5155,7 @@ static void service_notify_pidref(Unit *u, PidRef *parent_pidref, PidRef *child_ assert(pidref_is_set(child_pidref)); if (pidref_equal(&s->main_pid, parent_pidref)) { - r = service_set_main_pidref(s, TAKE_PIDREF(*child_pidref), /* start_timestamp= */ NULL); + r = service_set_main_pidref(s, TAKE_PIDREF(*child_pidref), /* start_timestamp = */ NULL); if (r < 0) return (void) log_unit_warning_errno(u, r, "Failed to set new main pid: %m"); @@ -5254,7 +5254,7 @@ static int bus_name_pid_lookup_callback(sd_bus_message *reply, void *userdata, s log_unit_debug(UNIT(s), "D-Bus name %s is now owned by process " PID_FMT, s->bus_name, pidref.pid); - (void) service_set_main_pidref(s, TAKE_PIDREF(pidref), /* start_timestamp= */ NULL); + (void) service_set_main_pidref(s, TAKE_PIDREF(pidref), /* start_timestamp = */ NULL); (void) unit_watch_pidref(UNIT(s), &s->main_pid, /* exclusive= */ false); return 1; } diff --git a/src/core/slice.c b/src/core/slice.c index dfd5b6cdba1..0ace5577b68 100644 --- a/src/core/slice.c +++ b/src/core/slice.c @@ -45,7 +45,7 @@ static void slice_set_state(Slice *s, SliceState state) { log_unit_debug(UNIT(s), "Changed %s -> %s", slice_state_to_string(old_state), slice_state_to_string(state)); - unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static int slice_add_parent_slice(Slice *s) { diff --git a/src/core/socket.c b/src/core/socket.c index cb79c590aa7..4d904f6f093 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1900,7 +1900,7 @@ static void socket_set_state(Socket *s, SocketState state) { if (state != old_state) log_unit_debug(UNIT(s), "Changed %s -> %s", socket_state_to_string(old_state), socket_state_to_string(state)); - unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static int socket_coldplug(Unit *u) { @@ -2124,13 +2124,13 @@ static void socket_enter_dead(Socket *s, SocketResult f) { else unit_log_failure(UNIT(s), socket_result_to_string(s->result)); - unit_warn_leftover_processes(UNIT(s), /* start= */ false); + unit_warn_leftover_processes(UNIT(s), /* start = */ false); socket_set_state(s, s->result != SOCKET_SUCCESS ? SOCKET_FAILED : SOCKET_DEAD); s->exec_runtime = exec_runtime_destroy(s->exec_runtime); - unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir= */ true); + unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir = */ true); unit_unref_uid_gid(UNIT(s), true); } @@ -2353,7 +2353,7 @@ static void socket_enter_start_pre(Socket *s) { socket_unwatch_control_pid(s); - unit_warn_leftover_processes(UNIT(s), /* start= */ true); + unit_warn_leftover_processes(UNIT(s), /* start = */ true); s->control_command_id = SOCKET_EXEC_START_PRE; s->control_command = s->exec_command[SOCKET_EXEC_START_PRE]; @@ -2398,7 +2398,7 @@ static bool socket_stop_notify(Unit *u) { assert(s->state == SOCKET_DEFERRED); - r = manager_add_job(u->manager, JOB_START, UNIT_DEREF(s->service), JOB_LENIENT, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_START, UNIT_DEREF(s->service), JOB_LENIENT, &error, /* ret = */ NULL); if (r >= 0) { /* Yay! */ socket_set_state(s, SOCKET_RUNNING); return true; /* changed */ @@ -2429,7 +2429,7 @@ static void socket_enter_deferred(Socket *s) { * Put a safety net around all this though, i.e. give up if the service still can't be started * even after all existing jobs have completed, or DeferTriggerMaxSec= is reached. */ - r = socket_arm_timer(s, /* relative= */ true, s->defer_trigger_max_usec); + r = socket_arm_timer(s, /* relative = */ true, s->defer_trigger_max_usec); if (r < 0) { log_unit_warning_errno(UNIT(s), r, "Failed to install timer: %m"); return socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES); @@ -2492,7 +2492,7 @@ static void socket_enter_running(Socket *s, int cfd_in) { } if (s->defer_trigger != SOCKET_DEFER_NO) { - r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_LENIENT, &error, /* ret= */ NULL); + r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_LENIENT, &error, /* ret = */ NULL); if (r < 0 && sd_bus_error_has_name(&error, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE) && socket_may_defer(s)) /* We only check BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE here, not * BUS_ERROR_TRANSACTION_JOBS_CONFLICTING or BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, @@ -2501,7 +2501,7 @@ static void socket_enter_running(Socket *s, int cfd_in) { * Deferring activation probably won't help. */ return socket_enter_deferred(s); } else - r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) goto queue_error; } @@ -2568,7 +2568,7 @@ static void socket_enter_running(Socket *s, int cfd_in) { s->n_connections++; - r = manager_add_job(UNIT(s)->manager, JOB_START, service, JOB_REPLACE, &error, /* ret= */ NULL); + r = manager_add_job(UNIT(s)->manager, JOB_START, service, JOB_REPLACE, &error, /* ret = */ NULL); if (r < 0) { /* We failed to activate the new service, but it still exists. Let's make sure the * service closes and forgets the connection fd again, immediately. */ @@ -2632,7 +2632,7 @@ static int socket_start(Unit *u) { "Socket service %s not loaded, refusing.", UNIT(service)->id); /* If the service is already active we cannot start the socket */ - if (SOCKET_SERVICE_IS_ACTIVE(service, /* allow_finalize= */ false)) + if (SOCKET_SERVICE_IS_ACTIVE(service, /* allow_finalize = */ false)) return log_unit_error_errno(u, SYNTHETIC_ERRNO(EBUSY), "Socket service %s already active, refusing.", UNIT(service)->id); } @@ -3521,7 +3521,7 @@ static void socket_trigger_notify(Unit *u, Unit *other) { if (other->job) return; - if (!SOCKET_SERVICE_IS_ACTIVE(service, /* allow_finalize= */ true)) + if (!SOCKET_SERVICE_IS_ACTIVE(service, /* allow_finalize = */ true)) socket_enter_listening(s); if (SERVICE(other)->state == SERVICE_RUNNING) diff --git a/src/core/swap.c b/src/core/swap.c index 3ab4b134f2a..fa7846cd465 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -351,7 +351,7 @@ static int swap_load(Unit *u) { assert(u->load_state == UNIT_STUB); /* Load a .swap file */ - r = unit_load_fragment_and_dropin(u, /* fragment_required= */ !s->from_proc_swaps); + r = unit_load_fragment_and_dropin(u, /* fragment_required = */ !s->from_proc_swaps); /* Add in some extras, and do so either when we successfully loaded something or when /proc/swaps is * already active. */ @@ -508,7 +508,7 @@ static void swap_set_state(Swap *s, SwapState state) { if (state != old_state) log_unit_debug(UNIT(s), "Changed %s -> %s", swap_state_to_string(old_state), swap_state_to_string(state)); - unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); /* If there other units for the same device node have a job queued it might be worth checking again if it is runnable @@ -672,13 +672,13 @@ static void swap_enter_dead(Swap *s, SwapResult f) { s->result = f; unit_log_result(UNIT(s), s->result == SWAP_SUCCESS, swap_result_to_string(s->result)); - unit_warn_leftover_processes(UNIT(s), /* start= */ false); + unit_warn_leftover_processes(UNIT(s), /* start = */ false); swap_set_state(s, s->result != SWAP_SUCCESS ? SWAP_FAILED : SWAP_DEAD); s->exec_runtime = exec_runtime_destroy(s->exec_runtime); - unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir= */ true); + unit_destroy_runtime_data(UNIT(s), &s->exec_context, /* destroy_runtime_dir = */ true); unit_unref_uid_gid(UNIT(s), true); } @@ -755,7 +755,7 @@ static void swap_enter_activating(Swap *s) { assert(s); - unit_warn_leftover_processes(UNIT(s), /* start= */ true); + unit_warn_leftover_processes(UNIT(s), /* start = */ true); s->control_command_id = SWAP_EXEC_ACTIVATE; s->control_command = s->exec_command + SWAP_EXEC_ACTIVATE; diff --git a/src/core/target.c b/src/core/target.c index 2f91396e2f1..880f8584819 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -29,7 +29,7 @@ static void target_set_state(Target *t, TargetState state) { log_unit_debug(UNIT(t), "Changed %s -> %s", target_state_to_string(old_state), target_state_to_string(state)); - unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static int target_add_default_dependencies(Target *t) { diff --git a/src/core/timer.c b/src/core/timer.c index d95514462d3..52762351752 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -300,7 +300,7 @@ static void timer_set_state(Timer *t, TimerState state) { if (state != old_state) log_unit_debug(UNIT(t), "Changed %s -> %s", timer_state_to_string(old_state), timer_state_to_string(state)); - unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true); + unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], /* reload_success = */ true); } static void timer_enter_waiting(Timer *t, bool time_change); diff --git a/src/core/transaction.c b/src/core/transaction.c index 59c7f8c97f6..536f9d78c30 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -256,12 +256,12 @@ static int transaction_merge_jobs(Transaction *tr, sd_bus_error *e) { assert(tr); /* First step, try to drop unmergeable jobs for jobs that matter to anchor. */ - r = transaction_ensure_mergeable(tr, /* matters_to_anchor= */ true, e); + r = transaction_ensure_mergeable(tr, /* matters_to_anchor = */ true, e); if (r < 0) return r; /* Second step, do the same for jobs that not matter to anchor. */ - r = transaction_ensure_mergeable(tr, /* matters_to_anchor= */ false, e); + r = transaction_ensure_mergeable(tr, /* matters_to_anchor = */ false, e); if (r < 0) return r; diff --git a/src/core/unit-serialize.c b/src/core/unit-serialize.c index d2aee125ddd..459ea141358 100644 --- a/src/core/unit-serialize.c +++ b/src/core/unit-serialize.c @@ -33,7 +33,7 @@ static int serialize_markers(FILE *f, unsigned markers) { fputs("markers=", f); BIT_FOREACH(m, markers) - fputs_with_separator(f, unit_marker_to_string(m), /* separator= */ NULL, &space); + fputs_with_separator(f, unit_marker_to_string(m), /* separator = */ NULL, &space); fputc('\n', f); return 0; } @@ -373,7 +373,7 @@ int unit_deserialize_state(Unit *u, FILE *f, FDSet *fds) { * wasn't the case in prior versions with the realized state tracked in a discrete field. * Patch cgroup_realized == 0 back to no cgroup_path here hence. */ if (crt->deserialized_cgroup_realized == 0) - unit_release_cgroup(u, /* drop_cgroup_runtime= */ false); + unit_release_cgroup(u, /* drop_cgroup_runtime = */ false); else { unit_invalidate_cgroup(u, _CGROUP_MASK_ALL); unit_invalidate_cgroup_bpf_firewall(u); diff --git a/src/core/unit.c b/src/core/unit.c index 7161c1cb6c4..6cb68ff8e1b 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -813,7 +813,7 @@ Unit* unit_free(Unit *u) { if (u->on_console) manager_unref_console(u->manager); - unit_release_cgroup(u, /* drop_cgroup_runtime= */ true); + unit_release_cgroup(u, /* drop_cgroup_runtime = */ true); if (!MANAGER_IS_RELOADING(u->manager)) unit_unlink_state_files(u); @@ -1551,8 +1551,8 @@ static int unit_add_mount_dependencies(Unit *u) { (void) manager_load_unit_prepare( u->manager, p, - /* path= */ NULL, - /* e= */ NULL, + /* path= */NULL, + /* e= */NULL, &m); continue; } @@ -2140,7 +2140,7 @@ int unit_reload(Unit *u) { if (!UNIT_VTABLE(u)->reload) { /* Unit doesn't have a reload function, but we need to propagate the reload anyway */ - unit_notify(u, unit_active_state(u), unit_active_state(u), /* reload_success= */ true); + unit_notify(u, unit_active_state(u), unit_active_state(u), /* reload_success = */ true); return 0; } @@ -2290,16 +2290,16 @@ static void retroactively_start_dependencies(Unit *u) { UNIT_FOREACH_DEPENDENCY_SAFE(other, u, UNIT_ATOM_RETROACTIVE_START_REPLACE) /* Requires= + BindsTo= */ if (!unit_has_dependency(u, UNIT_ATOM_AFTER, other) && !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other))) - (void) manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, /* reterr_error= */ NULL, /* ret= */ NULL); + (void) manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, /* reterr_error = */ NULL, /* ret = */ NULL); UNIT_FOREACH_DEPENDENCY_SAFE(other, u, UNIT_ATOM_RETROACTIVE_START_FAIL) /* Wants= */ if (!unit_has_dependency(u, UNIT_ATOM_AFTER, other) && !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other))) - (void) manager_add_job(u->manager, JOB_START, other, JOB_FAIL, /* reterr_error= */ NULL, /* ret= */ NULL); + (void) manager_add_job(u->manager, JOB_START, other, JOB_FAIL, /* reterr_error = */ NULL, /* ret = */ NULL); UNIT_FOREACH_DEPENDENCY_SAFE(other, u, UNIT_ATOM_RETROACTIVE_STOP_ON_START) /* Conflicts= (and inverse) */ if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other))) - (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* reterr_error= */ NULL, /* ret= */ NULL); + (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* reterr_error = */ NULL, /* ret = */ NULL); } static void retroactively_stop_dependencies(Unit *u) { @@ -2311,7 +2311,7 @@ static void retroactively_stop_dependencies(Unit *u) { /* Pull down units which are bound to us recursively if enabled */ UNIT_FOREACH_DEPENDENCY_SAFE(other, u, UNIT_ATOM_RETROACTIVE_STOP_ON_STOP) /* BoundBy= */ if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other))) - (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* reterr_error= */ NULL, /* ret= */ NULL); + (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* reterr_error = */ NULL, /* ret = */ NULL); } void unit_start_on_termination_deps(Unit *u, UnitDependencyAtom atom) { @@ -2342,7 +2342,7 @@ void unit_start_on_termination_deps(Unit *u, UnitDependencyAtom atom) { if (n_jobs == 0) log_unit_info(u, "Triggering %s dependencies.", dependency_name); - r = manager_add_job(u->manager, JOB_START, other, job_mode, &error, /* ret= */ NULL); + r = manager_add_job(u->manager, JOB_START, other, job_mode, &error, /* ret = */ NULL); if (r < 0) log_unit_warning_errno(u, r, "Failed to enqueue %s%s job, ignoring: %s", dependency_name, other->id, bus_error_message(&error, r)); @@ -2624,12 +2624,12 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) { case JOB_VERIFY_ACTIVE: if (UNIT_IS_ACTIVE_OR_RELOADING(ns)) - job_finish_and_invalidate(j, JOB_DONE, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, JOB_DONE, /* recursive = */ true, /* already = */ false); else if (j->state == JOB_RUNNING && ns != UNIT_ACTIVATING) { unexpected = true; if (UNIT_IS_INACTIVE_OR_FAILED(ns)) - job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_DONE, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_DONE, /* recursive = */ true, /* already = */ false); } break; @@ -2638,10 +2638,10 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) { if (j->state == JOB_RUNNING) { if (ns == UNIT_ACTIVE) - job_finish_and_invalidate(j, reload_success ? JOB_DONE : JOB_FAILED, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, reload_success ? JOB_DONE : JOB_FAILED, /* recursive = */ true, /* already = */ false); else if (!IN_SET(ns, UNIT_ACTIVATING, UNIT_RELOADING, UNIT_REFRESHING)) { unexpected = true; - job_finish_and_invalidate(j, reload_success ? JOB_CANCELED : JOB_FAILED, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, reload_success ? JOB_CANCELED : JOB_FAILED, /* recursive = */ true, /* already = */ false); } } @@ -2651,10 +2651,10 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) { case JOB_RESTART: if (UNIT_IS_INACTIVE_OR_FAILED(ns)) - job_finish_and_invalidate(j, JOB_DONE, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, JOB_DONE, /* recursive = */ true, /* already = */ false); else if (j->state == JOB_RUNNING && ns != UNIT_DEACTIVATING) { unexpected = true; - job_finish_and_invalidate(j, JOB_FAILED, /* recursive= */ true, /* already= */ false); + job_finish_and_invalidate(j, JOB_FAILED, /* recursive = */ true, /* already = */ false); } break; @@ -3346,7 +3346,7 @@ int setenv_unit_path(const char *p) { assert(p); /* This is mostly for debug purposes */ - return RET_NERRNO(setenv("SYSTEMD_UNIT_PATH", p, /* overwrite= */ true)); + return RET_NERRNO(setenv("SYSTEMD_UNIT_PATH", p, /* overwrite = */ true)); } char* unit_dbus_path(Unit *u) { @@ -3641,7 +3641,7 @@ int unit_install_bus_match(Unit *u, sd_bus *bus, const char *name) { r = bus_add_match_full( bus, &u->match_bus_slot, - /* asynchronous= */ true, + /* asynchronous = */ true, match, signal_name_owner_changed, signal_name_owner_changed_install_handler, @@ -3801,7 +3801,7 @@ int unit_coldplug(Unit *u) { if (u->nop_job) RET_GATHER(r, job_coldplug(u->nop_job)); - unit_modify_nft_set(u, /* add= */ true); + unit_modify_nft_set(u, /* add = */ true); return r; } @@ -3858,7 +3858,7 @@ bool unit_need_daemon_reload(Unit *u) { if (u->load_state == UNIT_LOADED) { _cleanup_strv_free_ char **dropins = NULL; - (void) unit_find_dropin_paths(u, /* use_unit_path_cache= */ false, &dropins); + (void) unit_find_dropin_paths(u, /* use_unit_path_cache = */ false, &dropins); if (!strv_equal(u->dropin_paths, dropins)) return true; @@ -4313,7 +4313,7 @@ static int unit_verify_contexts(const Unit *u) { return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "WorkingDirectory=~ is not allowed under DynamicUser=yes. Refusing."); if (ec->working_directory && path_below_api_vfs(ec->working_directory) && - exec_needs_mount_namespace(ec, /* params= */ NULL, /* runtime= */ NULL)) + exec_needs_mount_namespace(ec, /* params = */ NULL, /* runtime = */ NULL)) return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "WorkingDirectory= may not be below /proc/, /sys/ or /dev/ when using mount namespacing. Refusing."); if (exec_needs_pid_namespace(ec, /* params= */ NULL) && !UNIT_VTABLE(u)->notify_pidref) @@ -4955,7 +4955,7 @@ int unit_kill_context(Unit *u, KillOperation k) { r = unit_kill_context_one(u, main_pid, "main", is_alien, sig, send_sighup, log_func); wait_for_exit = wait_for_exit || r > 0; - r = unit_kill_context_one(u, unit_control_pid(u), "control", /* is_alien= */ false, sig, send_sighup, log_func); + r = unit_kill_context_one(u, unit_control_pid(u), "control", /* is_alien = */ false, sig, send_sighup, log_func); wait_for_exit = wait_for_exit || r > 0; CGroupRuntime *crt = unit_get_cgroup_runtime(u); @@ -5340,7 +5340,7 @@ static void unit_unref_uid_internal( static void unit_unref_uid(Unit *u, bool destroy_now) { assert(u); - unit_modify_user_nft_set(u, /* add= */ false, NFT_SET_SOURCE_USER, u->ref_uid); + unit_modify_user_nft_set(u, /* add = */ false, NFT_SET_SOURCE_USER, u->ref_uid); unit_unref_uid_internal(u, &u->ref_uid, destroy_now, manager_unref_uid); } @@ -5348,7 +5348,7 @@ static void unit_unref_uid(Unit *u, bool destroy_now) { static void unit_unref_gid(Unit *u, bool destroy_now) { assert(u); - unit_modify_user_nft_set(u, /* add= */ false, NFT_SET_SOURCE_GROUP, u->ref_gid); + unit_modify_user_nft_set(u, /* add = */ false, NFT_SET_SOURCE_GROUP, u->ref_gid); unit_unref_uid_internal(u, (uid_t*) &u->ref_gid, destroy_now, manager_unref_gid); } @@ -5444,8 +5444,8 @@ int unit_ref_uid_gid(Unit *u, uid_t uid, gid_t gid) { if (r < 0) return log_unit_warning_errno(u, r, "Couldn't add UID/GID reference to unit, proceeding without: %m"); - unit_modify_user_nft_set(u, /* add= */ true, NFT_SET_SOURCE_USER, uid); - unit_modify_user_nft_set(u, /* add= */ true, NFT_SET_SOURCE_GROUP, gid); + unit_modify_user_nft_set(u, /* add = */ true, NFT_SET_SOURCE_USER, uid); + unit_modify_user_nft_set(u, /* add = */ true, NFT_SET_SOURCE_GROUP, gid); return r; } @@ -6484,7 +6484,7 @@ void unit_freezer_complete(Unit *u, FreezerState kernel_state) { freezer_state_to_string(u->freezer_state)); /* If the cgroup's final state is against what's requested by us, report as canceled. */ - bus_unit_send_pending_freezer_message(u, /* canceled= */ !expected); + bus_unit_send_pending_freezer_message(u, /* canceled = */ !expected); } int unit_freezer_action(Unit *u, FreezerAction action) { @@ -6791,7 +6791,7 @@ int unit_get_exec_quota_stats(Unit *u, ExecContext *c, ExecDirectoryType dt, uin return log_unit_debug_errno(u, errno, "Failed to get exec quota stats: %m"); uint32_t proj_id; - r = read_fs_xattr_fd(fd, /* ret_xflags= */ NULL, &proj_id); + r = read_fs_xattr_fd(fd, /* ret_xflags = */ NULL, &proj_id); if (r < 0) return log_unit_debug_errno(u, r, "Failed to get project ID for exec quota stats: %m"); diff --git a/src/core/varlink-execute.c b/src/core/varlink-execute.c index 70e43386c4e..afba470e468 100644 --- a/src/core/varlink-execute.c +++ b/src/core/varlink-execute.c @@ -848,7 +848,7 @@ int unit_exec_context_build_json(sd_json_variant **ret, const char *name, void * JSON_BUILD_PAIR_STRING_NON_EMPTY("Personality", personality_to_string(c->personality)), SD_JSON_BUILD_PAIR_BOOLEAN("IgnoreSIGPIPE", c->ignore_sigpipe), - /* Scheduling */ + /* Scheduling */ SD_JSON_BUILD_PAIR_INTEGER("Nice", exec_context_get_nice(c)), SD_JSON_BUILD_PAIR_CALLBACK("CPUSchedulingPolicy", cpu_sched_class_build_json, c), SD_JSON_BUILD_PAIR_INTEGER("CPUSchedulingPriority", exec_context_get_cpu_sched_priority(c)), @@ -915,7 +915,7 @@ int unit_exec_context_build_json(sd_json_variant **ret, const char *name, void * JSON_BUILD_PAIR_CALLBACK_NON_NULL("SystemCallArchitectures", syscall_archs_build_json, c), JSON_BUILD_PAIR_CALLBACK_NON_NULL("SystemCallLog", syscall_log_build_json, c), - /* Environment */ + /* Environment */ JSON_BUILD_PAIR_STRV_NON_EMPTY("Environment", c->environment), JSON_BUILD_PAIR_CALLBACK_NON_NULL("EnvironmentFiles", environment_files_build_json, c->environment_files), JSON_BUILD_PAIR_STRV_NON_EMPTY("PassEnvironment", c->pass_environment), diff --git a/src/core/varlink-unit.c b/src/core/varlink-unit.c index ccfb7656494..6de47cfeb77 100644 --- a/src/core/varlink-unit.c +++ b/src/core/varlink-unit.c @@ -487,7 +487,7 @@ int vl_method_list_units(sd_varlink *link, sd_json_variant *parameters, sd_varli if (r < 0) return r; if (unit) - return list_unit_one_with_selinux_access_check(link, unit, /* more= */ false); + return list_unit_one_with_selinux_access_check(link, unit, /* more = */ false); if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE)) return sd_varlink_error(link, SD_VARLINK_ERROR_EXPECTED_MORE, NULL); @@ -498,7 +498,7 @@ int vl_method_list_units(sd_varlink *link, sd_json_variant *parameters, sd_varli continue; if (previous) { - r = list_unit_one(link, previous, /* more= */ true); + r = list_unit_one(link, previous, /* more = */ true); if (r < 0) return r; } @@ -507,7 +507,7 @@ int vl_method_list_units(sd_varlink *link, sd_json_variant *parameters, sd_varli } if (previous) - return list_unit_one(link, previous, /* more= */ false); + return list_unit_one(link, previous, /* more = */ false); return sd_varlink_error(link, "io.systemd.Manager.NoSuchUnit", NULL); } diff --git a/src/core/varlink.c b/src/core/varlink.c index 9834497881e..fe077c699c5 100644 --- a/src/core/varlink.c +++ b/src/core/varlink.c @@ -147,7 +147,7 @@ static int manager_varlink_send_managed_oom_initial(Manager *m) { assert(m->managed_oom_varlink); - r = build_managed_oom_cgroups_json(m, /* allow_empty= */ false, &v); + r = build_managed_oom_cgroups_json(m, /* allow_empty = */ false, &v); if (r <= 0) return r; @@ -323,7 +323,7 @@ static int vl_method_subscribe_managed_oom_cgroups( if (!streq(u->id, "systemd-oomd.service")) return sd_varlink_error(link, SD_VARLINK_ERROR_PERMISSION_DENIED, NULL); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -334,7 +334,7 @@ static int vl_method_subscribe_managed_oom_cgroups( _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL; - r = build_managed_oom_cgroups_json(m, /* allow_empty= */ true, &v); + r = build_managed_oom_cgroups_json(m, /* allow_empty = */ true, &v); if (r < 0) return r; diff --git a/src/coredump/coredump-context.c b/src/coredump/coredump-context.c index 921cfe5de76..399de7f0d92 100644 --- a/src/coredump/coredump-context.c +++ b/src/coredump/coredump-context.c @@ -320,7 +320,7 @@ static void coredump_context_check_pidns(CoredumpContext *context) { assert(context); assert(pidref_is_set(&context->pidref)); - r = pidref_in_same_namespace(/* pid1= */ NULL, &context->pidref, NAMESPACE_PID); + r = pidref_in_same_namespace(/* pid1 = */ NULL, &context->pidref, NAMESPACE_PID); if (r < 0) log_debug_errno(r, "Failed to check pidns of crashing process, ignoring: %m"); diff --git a/src/cryptenroll/cryptenroll-password.c b/src/cryptenroll/cryptenroll-password.c index 26503187133..7761aba21f8 100644 --- a/src/cryptenroll/cryptenroll-password.c +++ b/src/cryptenroll/cryptenroll-password.c @@ -188,7 +188,7 @@ int enroll_password( } } - r = check_password_quality(new_password, /* old= */ NULL, /* user= */ NULL, &error); + r = check_password_quality(new_password, /* old = */ NULL, /* user = */ NULL, &error); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) log_warning("Password quality check is not supported, proceeding anyway."); else if (r < 0) diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c index b2c291a2bd4..5a0d9722421 100644 --- a/src/cryptenroll/cryptenroll.c +++ b/src/cryptenroll/cryptenroll.c @@ -491,7 +491,7 @@ static int parse_argv(int argc, char *argv[]) { _cleanup_free_ char *device = NULL; if (streq(optarg, "list")) - return tpm2_list_devices(/* legend= */ true, /* quiet= */ false); + return tpm2_list_devices(/* legend = */ true, /* quiet = */ false); if (arg_enroll_type >= 0 || arg_tpm2_device) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index a4068036046..e7d71779226 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -401,7 +401,7 @@ static int create_disk( keydev, "keydev", keyfile_timeout_value, - /* canfail= */ keyfile_can_timeout > 0, + /* canfail = */ keyfile_can_timeout > 0, /* readonly= */ true, &unit, &keydev_mount); @@ -441,7 +441,7 @@ static int create_disk( headerdev, "headerdev", NULL, - /* canfail= */ false, /* header is always necessary */ + /* canfail= */ false, /* header is always necessary */ /* readonly= */ false, /* LUKS2 recovery requires rw header access */ &unit, &headerdev_mount); diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index eb545fd0234..7c924980d3c 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -1516,7 +1516,7 @@ static int crypt_activate_by_token_pin_ask_password( _cleanup_strv_free_erase_ char **pins = NULL; int r; - r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, /* pin= */ NULL, /* pin_size= */ 0, userdata, activation_flags); + r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, /* pin=*/ NULL, /* pin_size= */ 0, userdata, activation_flags); if (r > 0) /* returns unlocked keyslot id on success */ return 0; if (r == -EEXIST) /* volume is already active */ diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c index 878e1152328..86014b85f70 100644 --- a/src/debug-generator/debug-generator.c +++ b/src/debug-generator/debug-generator.c @@ -347,7 +347,7 @@ static int process_unit_credentials(const char *credentials_dir) { continue; } - r = write_drop_in(arg_dest, dropin_unit, /* level= */ UINT_MAX, dropin_name, d); + r = write_drop_in(arg_dest, dropin_unit, /* level = */ UINT_MAX, dropin_name, d); if (r < 0) { log_warning_errno(r, "Failed to write drop-in '%s' for unit '%s' from credential '%s', ignoring: %m", dropin_name, dropin_unit, de->d_name); diff --git a/src/delta/delta.c b/src/delta/delta.c index 7eb9d91871c..d13516e3107 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -259,12 +259,12 @@ static int enumerate_dir_d( continue; log_debug("Adding at top: %s %s %s/%s", *file, glyph(GLYPH_ARROW_RIGHT), path, *file); - r = path_put(top, path, *file, /* override= */ false); + r = path_put(top, path, *file, /* override = */ false); if (r < 0) return r; log_debug("Adding at bottom: %s %s %s/%s", *file, glyph(GLYPH_ARROW_RIGHT), path, *file); - r = path_put(bottom, path, *file, /* override= */ true); + r = path_put(bottom, path, *file, /* override = */ true); if (r < 0) return r; @@ -285,7 +285,7 @@ static int enumerate_dir_d( log_debug("Adding to drops: %s %s %s %s %s/%s", unit, glyph(GLYPH_ARROW_RIGHT), *file, glyph(GLYPH_ARROW_RIGHT), path, *file); - r = path_put(&h, path, *file, /* override= */ false); + r = path_put(&h, path, *file, /* override = */ false); if (r < 0) return r; } @@ -352,12 +352,12 @@ static int enumerate_dir( STRV_FOREACH(t, files) { log_debug("Adding at top: %s %s %s/%s", *t, glyph(GLYPH_ARROW_RIGHT), path, *t); - r = path_put(top, path, *t, /* override= */ false); + r = path_put(top, path, *t, /* override = */ false); if (r < 0) return r; log_debug("Adding at bottom: %s %s %s/%s", *t, glyph(GLYPH_ARROW_RIGHT), path, *t); - r = path_put(bottom, path, *t, /* override= */ true); + r = path_put(bottom, path, *t, /* override = */ true); if (r < 0) return r; } diff --git a/src/factory-reset/factory-reset-tool.c b/src/factory-reset/factory-reset-tool.c index 2f0fe97ca6f..f2c4c7ca436 100644 --- a/src/factory-reset/factory-reset-tool.c +++ b/src/factory-reset/factory-reset-tool.c @@ -248,7 +248,7 @@ static int retrigger_block_devices(void) { if (r < 0) return log_error_errno(r, "Failed to enable enumeration of uninitialized devices: %m"); - r = sd_device_enumerator_add_match_subsystem(e, "block", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "block", /* match = */ true); if (r < 0) return log_error_errno(r, "Failed to filter device enumeration by 'block' subsystem: %m"); diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 55bd273f21a..4ea2523d967 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -785,7 +785,7 @@ static int prompt_root_password(int rfd, sd_varlink **mute_console_link) { break; } - r = check_password_quality(*a, /* old= */ NULL, "root", &error); + r = check_password_quality(*a, /* old = */ NULL, "root", &error); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) log_warning("Password quality check is not supported, proceeding anyway."); else if (r < 0) @@ -1035,7 +1035,7 @@ static int process_root_account(int rfd, sd_varlink **mute_console_link) { /* Ensure that passwd and shadow are in the same directory and are not symlinks. */ FOREACH_STRING(s, "passwd", "shadow") { - r = verify_regular_at(pfd, s, /* follow= */ false); + r = verify_regular_at(pfd, s, /* follow = */ false); if (r < 0 && r != -ENOENT) return log_error_errno(r, "Verification of /etc/%s being regular file failed: %m", s); @@ -1681,7 +1681,7 @@ static int run(int argc, char *argv[]) { * opposed to some other file system tree/image) */ bool enabled; - r = proc_cmdline_get_bool("systemd.firstboot", /* flags= */ 0, &enabled); + r = proc_cmdline_get_bool("systemd.firstboot", /* flags = */ 0, &enabled); if (r < 0) return log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); if (r > 0 && !enabled) { diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index 6ea5a9f0e7c..86c26c96df9 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -133,7 +133,7 @@ static void parse_credentials(void) { _cleanup_free_ char *value = NULL; int r; - r = read_credential("fsck.mode", (void**) &value, /* ret_size= */ NULL); + r = read_credential("fsck.mode", (void**) &value, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential 'fsck.mode', ignoring: %m"); else { @@ -144,7 +144,7 @@ static void parse_credentials(void) { value = mfree(value); - r = read_credential("fsck.repair", (void**) &value, /* ret_size= */ NULL); + r = read_credential("fsck.repair", (void**) &value, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential 'fsck.repair', ignoring: %m"); else { diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index d60db7e9c1d..3c26e648965 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -1039,7 +1039,7 @@ static int parse_fstab(bool prefix_sysroot) { log_debug("Parsing %s...", fstab); - r = libmount_parse_full(fstab, /* source= */ NULL, MNT_ITER_FORWARD, &table, &iter); + r = libmount_parse_full(fstab, /* source = */ NULL, MNT_ITER_FORWARD, &table, &iter); if (r == -ENOENT) return 0; if (r < 0) @@ -1062,8 +1062,8 @@ static int parse_fstab(bool prefix_sysroot) { sym_mnt_fs_get_options(fs), sym_mnt_fs_get_passno(fs), prefix_sysroot, - /* accept_root= */ false, - /* use_swap_enabled= */ true); + /* accept_root = */ false, + /* use_swap_enabled = */ true); if (arg_sysroot_check && r > 0) return true; /* We found a mount or swap that would be started… */ RET_GATHER(ret, r); @@ -1233,7 +1233,7 @@ static int add_sysroot_mount(void) { /* Only honor x-systemd.makefs and .validatefs here, others are not relevant in initrd/not used * at all (also see mandatory_mount_drop_unapplicable_options()) */ - flags = fstab_options_to_flags(combined_options, /* is_swap= */ false) & (MOUNT_MAKEFS|MOUNT_VALIDATEFS); + flags = fstab_options_to_flags(combined_options, /* is_swap = */ false) & (MOUNT_MAKEFS|MOUNT_VALIDATEFS); return add_mount("/proc/cmdline", arg_dest, @@ -1411,10 +1411,10 @@ static int add_mounts_from_cmdline(void) { m->where, m->fstype, m->options, - /* passno= */ -1, - /* prefix_sysroot= */ !m->for_initrd && in_initrd(), - /* accept_root= */ true, - /* use_swap_enabled= */ false)); + /* passno = */ -1, + /* prefix_sysroot = */ !m->for_initrd && in_initrd(), + /* accept_root = */ true, + /* use_swap_enabled = */ false)); } return r; @@ -1463,8 +1463,8 @@ static int add_mounts_from_creds(bool prefix_sysroot) { sym_mnt_fs_get_options(fs), sym_mnt_fs_get_passno(fs), prefix_sysroot, - /* accept_root= */ true, - /* use_swap_enabled= */ true)); + /* accept_root = */ true, + /* use_swap_enabled = */ true)); } } @@ -1655,7 +1655,7 @@ static int run_generator(void) { (void) determine_usr(); if (arg_sysroot_check) { - r = parse_fstab(/* prefix_sysroot= */ true); + r = parse_fstab(/* prefix_sysroot = */ true); if (r == 0) log_debug("Nothing interesting found, not doing daemon-reload."); if (r > 0) @@ -1678,21 +1678,21 @@ static int run_generator(void) { /* Honour /etc/fstab only when that's enabled */ if (arg_fstab_enabled) { /* Parse the local /etc/fstab, possibly from the initrd */ - RET_GATHER(r, parse_fstab(/* prefix_sysroot= */ false)); + RET_GATHER(r, parse_fstab(/* prefix_sysroot = */ false)); /* If running in the initrd also parse the /etc/fstab from the host */ if (in_initrd()) - RET_GATHER(r, parse_fstab(/* prefix_sysroot= */ true)); + RET_GATHER(r, parse_fstab(/* prefix_sysroot = */ true)); else RET_GATHER(r, generator_enable_remount_fs_service(arg_dest)); } RET_GATHER(r, add_mounts_from_cmdline()); - RET_GATHER(r, add_mounts_from_creds(/* prefix_sysroot= */ false)); + RET_GATHER(r, add_mounts_from_creds(/* prefix_sysroot = */ false)); if (in_initrd()) - RET_GATHER(r, add_mounts_from_creds(/* prefix_sysroot= */ true)); + RET_GATHER(r, add_mounts_from_creds(/* prefix_sysroot = */ true)); return r; } diff --git a/src/fuzz/fuzz-compress.c b/src/fuzz/fuzz-compress.c index bcb276346fc..bf53de92795 100644 --- a/src/fuzz/fuzz-compress.c +++ b/src/fuzz/fuzz-compress.c @@ -41,7 +41,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { } size_t csize; - r = compress_blob(alg, h->data, data_len, buf, size, &csize, /* level= */ -1); + r = compress_blob(alg, h->data, data_len, buf, size, &csize, /* level = */ -1); if (r < 0) { log_error_errno(r, "Compression failed: %m"); return 0; diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c index 69ef0aae04c..bedfda81bd3 100644 --- a/src/getty-generator/getty-generator.c +++ b/src/getty-generator/getty-generator.c @@ -207,7 +207,7 @@ static int parse_getty_sources(const char *s, GettySourceFlag *ret) { for (const char *p = s;;) { _cleanup_free_ char *word = NULL; - r = extract_first_word(&p, &word, ",", /* flags= */ 0); + r = extract_first_word(&p, &word, ",", /* flags = */ 0); if (r < 0) return r; if (r == 0) @@ -262,7 +262,7 @@ static void parse_credentials(void) { _cleanup_free_ char *value = NULL; int r; - r = read_credential_with_decryption("getty.auto", (void**) &value, /* ret_size= */ NULL); + r = read_credential_with_decryption("getty.auto", (void**) &value, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential 'getty.auto', ignoring: %m"); else if (r > 0) { diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 5a4e5d101e2..ac9b3456bb0 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -94,7 +94,7 @@ static int add_cryptsetup( if (r < 0) return log_error_errno(r, "Failed to generate unit name: %m"); - r = generator_open_unit_file(arg_dest_late, /* source= */ NULL, n, &f); + r = generator_open_unit_file(arg_dest_late, /* source = */ NULL, n, &f); if (r < 0) return r; @@ -141,7 +141,7 @@ static int add_cryptsetup( if (r < 0) return log_error_errno(r, "Failed to write file %s: %m", n); - r = generator_write_device_timeout(arg_dest_late, what, mount_opts, /* filtered= */ NULL); + r = generator_write_device_timeout(arg_dest_late, what, mount_opts, /* filtered = */ NULL); if (r < 0) return r; @@ -313,7 +313,7 @@ static int add_mount( if (streq_ptr(fstype, "crypto_LUKS")) { /* Mount options passed are determined by partition_pick_mount_options(), whose result * is known to not contain timeout options. */ - r = add_cryptsetup(id, what, /* mount_opts= */ NULL, flags, /* require= */ true, &crypto_what); + r = add_cryptsetup(id, what, /* mount_opts = */ NULL, flags, /* require= */ true, &crypto_what); if (r < 0) return r; @@ -338,7 +338,7 @@ static int add_mount( if (r < 0) return log_error_errno(r, "Failed to generate unit name: %m"); - r = generator_open_unit_file(arg_dest_late, /* source= */ NULL, unit, &f); + r = generator_open_unit_file(arg_dest_late, /* source = */ NULL, unit, &f); if (r < 0) return r; @@ -417,7 +417,7 @@ static int path_is_busy(const char *where) { assert(where); /* already a mountpoint; generators run during reload */ - r = path_is_mount_point_full(where, /* root= */ NULL, AT_SYMLINK_FOLLOW); + r = path_is_mount_point_full(where, /* root = */ NULL, AT_SYMLINK_FOLLOW); if (r > 0) return false; /* The directory will be created by the mount or automount unit when it is started. */ @@ -504,7 +504,7 @@ static int add_partition_swap(DissectedPartition *p) { } if (streq_ptr(p->fstype, "crypto_LUKS")) { - r = add_cryptsetup("swap", p->node, /* mount_opts= */ NULL, MOUNT_RW, /* require= */ true, &crypto_what); + r = add_cryptsetup("swap", p->node, /* mount_opts = */ NULL, MOUNT_RW, /* require= */ true, &crypto_what); if (r < 0) return r; what = crypto_what; @@ -517,7 +517,7 @@ static int add_partition_swap(DissectedPartition *p) { if (r < 0) return log_error_errno(r, "Failed to generate unit name: %m"); - r = generator_open_unit_file(arg_dest_late, /* source= */ NULL, name, &f); + r = generator_open_unit_file(arg_dest_late, /* source = */ NULL, name, &f); if (r < 0) return r; @@ -576,7 +576,7 @@ static int add_automount( if (r < 0) return log_error_errno(r, "Failed to generate unit name: %m"); - r = generator_open_unit_file(arg_dest_late, /* source= */ NULL, unit, &f); + r = generator_open_unit_file(arg_dest_late, /* source = */ NULL, unit, &f); if (r < 0) return r; @@ -976,7 +976,7 @@ static int add_usr_mount(void) { "/dev/disk/by-designator/usr", in_initrd() ? "/sysusr/usr" : "/usr", arg_usr_fstype, - /* flags= */ 0, + /* flags = */ 0, options, "/usr/ Partition", in_initrd() ? SPECIAL_INITRD_USR_FS_TARGET : SPECIAL_LOCAL_FS_TARGET); diff --git a/src/growfs/makefs.c b/src/growfs/makefs.c index 3747bc0ee28..22bea9e24ae 100644 --- a/src/growfs/makefs.c +++ b/src/growfs/makefs.c @@ -68,13 +68,13 @@ static int run(int argc, char *argv[]) { return make_filesystem(device, fstype, label, - /* root= */ NULL, + /* root = */ NULL, uuid, MKFS_DISCARD | MKFS_QUIET, - /* sector_size= */ 0, - /* compression= */ NULL, - /* compression_level= */ NULL, - /* extra_mkfs_options= */ NULL); + /* sector_size = */ 0, + /* compression = */ NULL, + /* compression_level = */ NULL, + /* extra_mkfs_options = */ NULL); } DEFINE_MAIN_FUNCTION(run); diff --git a/src/hibernate-resume/hibernate-resume-generator.c b/src/hibernate-resume/hibernate-resume-generator.c index 79c7d41bb45..07f6b89f6d5 100644 --- a/src/hibernate-resume/hibernate-resume-generator.c +++ b/src/hibernate-resume/hibernate-resume-generator.c @@ -69,11 +69,11 @@ static int add_dissected_swap_cryptsetup(void) { * resume from hibernation can be automatically initiated there. This mostly follows what gpt-auto does, * but operates in initrd. */ - r = generator_open_unit_file(arg_dest_late, /* source= */ NULL, "systemd-cryptsetup@swap.service", &f); + r = generator_open_unit_file(arg_dest_late, /* source = */ NULL, "systemd-cryptsetup@swap.service", &f); if (r < 0) return r; - r = generator_write_cryptsetup_unit_section(f, /* source= */ NULL); + r = generator_write_cryptsetup_unit_section(f, /* source = */ NULL); if (r < 0) return r; @@ -85,7 +85,7 @@ static int add_dissected_swap_cryptsetup(void) { r = generator_write_cryptsetup_service_section( f, "swap", DISSECTED_SWAP_LUKS_DEVICE, - /* key_file= */ NULL, + /* key_file = */ NULL, efi_measured_uki(LOG_DEBUG) > 0 ? "tpm2-device=auto" : NULL); if (r < 0) return r; @@ -96,7 +96,7 @@ static int add_dissected_swap_cryptsetup(void) { r = generator_write_device_timeout(arg_dest_late, DISSECTED_SWAP_LUKS_DEVICE, - arg_resume_options ?: arg_root_options, /* filtered= */ NULL); + arg_resume_options ?: arg_root_options, /* filtered = */ NULL); if (r < 0) return r; diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c index f3cf399e1d8..e16bf825c93 100644 --- a/src/hibernate-resume/hibernate-resume.c +++ b/src/hibernate-resume/hibernate-resume.c @@ -113,7 +113,7 @@ static int action_clear(void) { /* Let's insist that the system identifier is verified still. After all if things don't match, * the resume wouldn't get triggered in the first place. We should not erase the var if booted * from LiveCD/portable systems/... */ - r = get_efi_hibernate_location(/* ret= */ NULL); + r = get_efi_hibernate_location(/* ret = */ NULL); if (r <= 0) return r; diff --git a/src/home/homectl.c b/src/home/homectl.c index 8d8f2c0f121..15dec438bdb 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -604,7 +604,7 @@ static int acquire_passed_secrets(const char *user_name, UserRecord **ret) { r = acquire_existing_password( user_name, secret, - /* emphasize_current_password= */ false, + /* emphasize_current_password = */ false, ASK_PASSWORD_ACCEPT_CACHED | ASK_PASSWORD_NO_TTY | ASK_PASSWORD_NO_AGENT); if (r < 0) return r; @@ -1240,7 +1240,7 @@ static int acquire_new_password( if (r > 0) { /* As above, this is not for use, just for testing */ - r = user_record_set_password(hr, STRV_MAKE(envpw), /* prepend= */ true); + r = user_record_set_password(hr, STRV_MAKE(envpw), /* prepend = */ true); if (r < 0) return log_error_errno(r, "Failed to store password: %m"); @@ -1304,7 +1304,7 @@ static int acquire_new_password( return log_oom(); } - r = user_record_set_password(hr, first, /* prepend= */ true); + r = user_record_set_password(hr, first, /* prepend = */ true); if (r < 0) return log_error_errno(r, "Failed to store password: %m"); @@ -1462,11 +1462,11 @@ static int create_home_common(sd_json_variant *input, bool show_enforce_password _cleanup_(erase_and_freep) char *new_password = NULL; /* No regular (i.e. non-PKCS#11) hashed passwords set in the record, let's fix that. */ - r = acquire_new_password(hr->user_name, hr, /* suggest= */ true, &new_password); + r = acquire_new_password(hr->user_name, hr, /* suggest = */ true, &new_password); if (r < 0) return r; - r = user_record_make_hashed_password(hr, STRV_MAKE(new_password), /* extend= */ false); + r = user_record_make_hashed_password(hr, STRV_MAKE(new_password), /* extend = */ false); if (r < 0) return log_error_errno(r, "Failed to hash password: %m"); } else { @@ -1538,11 +1538,11 @@ static int create_home_common(sd_json_variant *input, bool show_enforce_password if (show_enforce_password_policy_hint) log_info("(Use --enforce-password-policy=no to turn off password quality checks for this account.)"); - r = acquire_new_password(hr->user_name, hr, /* suggest= */ false, &new_password); + r = acquire_new_password(hr->user_name, hr, /* suggest = */ false, &new_password); if (r < 0) return r; - r = user_record_make_hashed_password(hr, STRV_MAKE(new_password), /* extend= */ false); + r = user_record_make_hashed_password(hr, STRV_MAKE(new_password), /* extend = */ false); if (r < 0) return log_error_errno(r, "Failed to hash passwords: %m"); } else { @@ -2116,7 +2116,7 @@ static int passwd_home(int argc, char *argv[], void *userdata) { if (!new_secret) return log_oom(); - r = acquire_new_password(username, new_secret, /* suggest= */ true, NULL); + r = acquire_new_password(username, new_secret, /* suggest = */ true, NULL); if (r < 0) return r; @@ -2146,7 +2146,7 @@ static int passwd_home(int argc, char *argv[], void *userdata) { log_error_errno(r, "%s", bus_error_message(&error, r)); - r = acquire_new_password(username, new_secret, /* suggest= */ false, NULL); + r = acquire_new_password(username, new_secret, /* suggest = */ false, NULL); } else if (sd_bus_error_has_name(&error, BUS_ERROR_BAD_PASSWORD_AND_NO_TOKEN)) @@ -2378,7 +2378,7 @@ static int with_home(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_create_error(r); - r = sd_bus_message_append(m, "b", /* please_suspend= */ getenv_bool("SYSTEMD_PLEASE_SUSPEND_HOME") > 0); + r = sd_bus_message_append(m, "b", /* please_suspend = */ getenv_bool("SYSTEMD_PLEASE_SUSPEND_HOME") > 0); if (r < 0) return bus_log_create_error(r); @@ -2784,7 +2784,7 @@ static int prompt_groups(const char *username, char ***ret_groups) { continue; } - r = groupdb_by_name(s, /* match= */ NULL, USERDB_SUPPRESS_SHADOW|USERDB_EXCLUDE_DYNAMIC_USER, /* ret= */ NULL); + r = groupdb_by_name(s, /* match= */ NULL, USERDB_SUPPRESS_SHADOW|USERDB_EXCLUDE_DYNAMIC_USER, /*ret=*/ NULL); if (r == -ESRCH) { log_notice("Specified auxiliary group does not exist, try again: %s", s); continue; @@ -2981,7 +2981,7 @@ static int verb_firstboot(int argc, char *argv[], void *userdata) { * tool. */ bool enabled; - r = proc_cmdline_get_bool("systemd.firstboot", /* flags= */ 0, &enabled); + r = proc_cmdline_get_bool("systemd.firstboot", /* flags = */ 0, &enabled); if (r < 0) return log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); if (r > 0 && !enabled) { @@ -4273,7 +4273,7 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(r, "Failed to parse SSH authorized keys list: %m"); } - r = strv_extend_strv_consume(&l, TAKE_PTR(add), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(&l, TAKE_PTR(add), /* filter_duplicates = */ true); if (r < 0) return log_oom(); diff --git a/src/home/homed-home.c b/src/home/homed-home.c index cd560c9a731..9c40a6179ee 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -1327,7 +1327,7 @@ static int home_start_work( if (r == 0) { /* Child */ - if (setenv("NOTIFY_SOCKET", h->manager->notify_socket_path, /* overwrite= */ true) < 0) { + if (setenv("NOTIFY_SOCKET", h->manager->notify_socket_path, /* overwrite = */ true) < 0) { log_error_errno(errno, "Failed to set $NOTIFY_SOCKET: %m"); _exit(EXIT_FAILURE); } @@ -2011,7 +2011,7 @@ int home_passwd(Home *h, * data. This is useful as a way to propagate updated user records into the LUKS backends * properly. */ - r = user_record_make_hashed_password(c, new_secret->password, /* extend= */ false); + r = user_record_make_hashed_password(c, new_secret->password, /* extend = */ false); if (r < 0) return r; diff --git a/src/home/homed-manager.c b/src/home/homed-manager.c index fe5bd0c2b77..c54cc43fd34 100644 --- a/src/home/homed-manager.c +++ b/src/home/homed-manager.c @@ -255,7 +255,7 @@ int manager_new(Manager **ret) { log_full_errno(ERRNO_IS_NOT_SUPPORTED(r) || ERRNO_IS_PRIVILEGE(r) || (r == -EHOSTDOWN) ? LOG_DEBUG : LOG_WARNING, r, "Failed to allocate memory pressure watch, ignoring: %m"); - r = sd_event_add_signal(m->event, /* ret= */ NULL, (SIGRTMIN+18)|SD_EVENT_SIGNAL_PROCMASK, sigrtmin18_handler, /* userdata= */ NULL); + r = sd_event_add_signal(m->event, /* ret= */ NULL, (SIGRTMIN+18)|SD_EVENT_SIGNAL_PROCMASK, sigrtmin18_handler, /* userdata = */ NULL); if (r < 0) return r; @@ -1162,9 +1162,9 @@ static int manager_listen_notify(Manager *m) { * of a client before it exits. */ on_notify_socket, m, - /* accept_fds= */ true, + /* accept_fds = */ true, &m->notify_socket_path, - /* ret_event_source= */ NULL); + /* ret_event_source = */ NULL); if (r < 0) return log_error_errno(r, "Failed to prepare notify socket: %m"); diff --git a/src/home/homework-fscrypt.c b/src/home/homework-fscrypt.c index 2d75d5d3fb8..ac45c191d73 100644 --- a/src/home/homework-fscrypt.c +++ b/src/home/homework-fscrypt.c @@ -336,11 +336,11 @@ static int fscrypt_setup( if (!e) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "xattr %s lacks ':' separator.", xa); - r = unbase64mem_full(value, e - value, /* secure= */ false, &salt, &salt_size); + r = unbase64mem_full(value, e - value, /* secure = */ false, &salt, &salt_size); if (r < 0) return log_error_errno(r, "Failed to decode salt of %s: %m", xa); - r = unbase64mem_full(e + 1, vsize - (e - value) - 1, /* secure= */ false, &encrypted, &encrypted_size); + r = unbase64mem_full(e + 1, vsize - (e - value) - 1, /* secure = */ false, &encrypted, &encrypted_size); if (r < 0) return log_error_errno(r, "Failed to decode encrypted key of %s: %m", xa); diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 316afb6f5ec..0b637c1fd98 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -2389,11 +2389,11 @@ int home_create_luks( r = make_filesystem(setup->dm_node, fstype, user_record_user_name_and_realm(h), - /* root= */ NULL, + /* root = */ NULL, fs_uuid, (user_record_luks_discard(h) ? MKFS_DISCARD : 0) | MKFS_QUIET, - /* sector_size= */ 0, - /* compression= */ NULL, + /* sector_size = */ 0, + /* compression = */ NULL, /* compression_level= */ NULL, extra_mkfs_options); if (r < 0) diff --git a/src/home/user-record-password-quality.c b/src/home/user-record-password-quality.c index 8f8a18a0dcb..b23f717c0e1 100644 --- a/src/home/user-record-password-quality.c +++ b/src/home/user-record-password-quality.c @@ -63,7 +63,7 @@ int user_record_check_password_quality( continue; /* If there are no old passwords, let's call check_password_quality() without any. */ - r = check_password_quality(*pp, /* old= */ NULL, hr->user_name, &auxerror); + r = check_password_quality(*pp, /* old = */ NULL, hr->user_name, &auxerror); if (r <= 0) goto error; } diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index fbe1b2fa7a8..9ba3d312bd1 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -862,7 +862,7 @@ static int context_write_data_machine_info(Context *c) { r = write_env_file( AT_FDCWD, etc_machine_info(), - /* headers= */ NULL, + /* headers= */NULL, l, WRITE_ENV_FILE_LABEL); if (r < 0) @@ -1687,7 +1687,7 @@ static int build_describe_response(Context *c, bool privileged, sd_json_variant (void) vsock_get_local_cid(&local_cid); (void) load_os_release_pairs(/* root= */ NULL, &os_release_pairs); - (void) load_env_file_pairs(/* f= */ NULL, etc_machine_info(), &machine_info_pairs); + (void) load_env_file_pairs(/* f=*/ NULL, etc_machine_info(), &machine_info_pairs); r = sd_json_buildo( &v, diff --git a/src/import/import-common.c b/src/import/import-common.c index c9d0672e7ff..28a913fdb73 100644 --- a/src/import/import-common.c +++ b/src/import/import-common.c @@ -423,7 +423,7 @@ int import_copy_foreign( r = copy_tree_at( source_fd, /* from= */ NULL, - target_fd, /* to= */ NULL, + target_fd, /* to = */ NULL, /* override_uid= */ UID_INVALID, /* override_gid= */ GID_INVALID, COPY_REFLINK|COPY_HARDLINKS|COPY_MERGE_EMPTY|COPY_MERGE_APPLY_STAT|COPY_SAME_MOUNT|COPY_ALL_XATTRS, diff --git a/src/import/import-generator.c b/src/import/import-generator.c index cdb1914604c..4aab1618d32 100644 --- a/src/import/import-generator.c +++ b/src/import/import-generator.c @@ -332,7 +332,7 @@ static int transfer_generate(const Transfer *t) { return log_error_errno(r, "Failed to build import unit name from '%s': %m", local_path); _cleanup_fclose_ FILE *f = NULL; - r = generator_open_unit_file(arg_dest, /* source= */ NULL, service, &f); + r = generator_open_unit_file(arg_dest, /* source = */ NULL, service, &f); if (r < 0) return r; diff --git a/src/import/pull-common.c b/src/import/pull-common.c index 4154487fd57..12d9736725c 100644 --- a/src/import/pull-common.c +++ b/src/import/pull-common.c @@ -450,7 +450,7 @@ static int verify_gpg( "--no-auto-check-trustdb", "--batch", "--trust-model=always", - NULL, /* --homedir= */ + NULL, /* --homedir= */ NULL, /* --keyring= */ NULL, /* --verify */ NULL, /* signature file */ diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index fe28d99d30e..d54c88a6393 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -474,9 +474,9 @@ static void tar_pull_job_on_finished(PullJob *j) { p->checksum_job, p->signature_job, p->settings_job, - /* roothash_job= */ NULL, - /* roothash_signature_job= */ NULL, - /* verity_job= */ NULL); + /* roothash_job = */ NULL, + /* roothash_signature_job = */ NULL, + /* verity_job = */ NULL); if (r < 0) goto finish; } diff --git a/src/integritysetup/integritysetup.c b/src/integritysetup/integritysetup.c index 5eed1b5665d..662d5a9b491 100644 --- a/src/integritysetup/integritysetup.c +++ b/src/integritysetup/integritysetup.c @@ -72,8 +72,8 @@ static int load_key_file( } static const char *integrity_algorithm_select(const void *key_file_buf) { - /* To keep a bit of sanity for end users, the subset of integrity - * algorithms we support will match what is used in integritysetup */ + /* To keep a bit of sanity for end users, the subset of integrity + algorithms we support will match what is used in integritysetup */ if (arg_integrity_algorithm) { if (streq(arg_integrity_algorithm, "hmac-sha256")) return DM_HMAC_256; diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index ee190827615..97acab82b70 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -470,11 +470,11 @@ static int request_parse_range( range_after_eq = startswith(range, "entries="); if (range_after_eq) - return request_parse_range_entries(m, skip_leading_chars(range_after_eq, /* bad= */ NULL)); + return request_parse_range_entries(m, skip_leading_chars(range_after_eq, /* bad = */ NULL)); range_after_eq = startswith(range, "realtime="); if (range_after_eq) - return request_parse_range_time(m, skip_leading_chars(range_after_eq, /* bad= */ NULL)); + return request_parse_range_time(m, skip_leading_chars(range_after_eq, /* bad = */ NULL)); return 0; } @@ -947,9 +947,9 @@ static ssize_t request_reader_boots( m->journal, LOG_BOOT_ID, /* boot_id */ SD_ID128_NULL, - /* unit= */ NULL, + /* unit = */ NULL, m->previous_boot_id, - /* advance_older= */ true, + /* advance_older = */ true, &boot); if (r < 0) { log_error_errno(r, "Failed to advance boot index: %m"); diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 19e25566d66..e8f23eefc1d 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -994,7 +994,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'o': - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_output); + r = parse_path_argument(optarg, /* suppress_root = */ false, &arg_output); if (r < 0) return r; break; diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c index 12f519bb2a7..387ce5603ae 100644 --- a/src/journal-remote/journal-remote-write.c +++ b/src/journal-remote/journal-remote-write.c @@ -44,7 +44,7 @@ int writer_new(RemoteServer *server, Writer **ret) { if (!w->mmap) return -ENOMEM; - if (is_dir(server->output, /* follow= */ true) > 0) { + if (is_dir(server->output, /* follow = */ true) > 0) { w->output = strdup(server->output); if (!w->output) return -ENOMEM; @@ -98,7 +98,7 @@ int writer_write(Writer *w, r = do_rotate(&w->journal, w->mmap, file_flags); if (r < 0) return r; - r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true); + r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose = */ true); if (r < 0) return r; } @@ -126,7 +126,7 @@ int writer_write(Writer *w, return r; else log_debug("%s: Successfully rotated journal", w->journal->path); - r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true); + r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose = */ true); if (r < 0) return r; diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index decb6df5da8..05f0dad0384 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -682,7 +682,7 @@ static int parse_config(void) { { "Upload", "TrustedCertificateFile", config_parse_path_or_ignore, 0, &arg_trust }, { "Upload", "NetworkTimeoutSec", config_parse_sec, 0, &arg_network_timeout_usec }, { "Upload", "Header", config_parse_header, 0, &arg_headers }, - { "Upload", "Compression", config_parse_compression, /* with_level= */ true, &arg_compression }, + { "Upload", "Compression", config_parse_compression, /* with_level = */ true, &arg_compression }, { "Upload", "ForceCompression", config_parse_bool, 0, &arg_force_compression }, {} }; diff --git a/src/journal/cat.c b/src/journal/cat.c index d1f4db80308..5a60414b561 100644 --- a/src/journal/cat.c +++ b/src/journal/cat.c @@ -167,7 +167,7 @@ static int run(int argc, char *argv[]) { "Failed to fstat(%s): %m", FORMAT_PROC_FD_PATH(STDERR_FILENO)); - r = setenvf("JOURNAL_STREAM", /* overwrite= */ true, DEV_FMT ":" INO_FMT, (dev_t) st.st_dev, st.st_ino); + r = setenvf("JOURNAL_STREAM", /* overwrite = */ true, DEV_FMT ":" INO_FMT, (dev_t) st.st_dev, st.st_ino); if (r < 0) return log_error_errno(r, "Failed to set environment variable JOURNAL_STREAM: %m"); diff --git a/src/journal/fuzz-journald-util.c b/src/journal/fuzz-journald-util.c index 7080b9412d9..cf624e6e425 100644 --- a/src/journal/fuzz-journald-util.c +++ b/src/journal/fuzz-journald-util.c @@ -33,5 +33,5 @@ void fuzz_journald_processing_function( _cleanup_(manager_freep) Manager *m = NULL; dummy_manager_new(&m, data, size); - f(m, m->buffer, size, /* ucred= */ NULL, /* tv= */ NULL, /* label= */ NULL, /* label_len= */ 0); + f(m, m->buffer, size, /* ucred = */ NULL, /* tv = */ NULL, /* label = */ NULL, /* label_len = */ 0); } diff --git a/src/journal/journalctl-authenticate.c b/src/journal/journalctl-authenticate.c index c31c31ef612..0728493e014 100644 --- a/src/journal/journalctl-authenticate.c +++ b/src/journal/journalctl-authenticate.c @@ -72,7 +72,7 @@ int action_setup_keys(void) { assert(arg_action == ACTION_SETUP_KEYS); - r = is_dir("/var/log/journal/", /* follow= */ false); + r = is_dir("/var/log/journal/", /* follow = */ false); if (r == 0) return log_error_errno(SYNTHETIC_ERRNO(ENOTDIR), "/var/log/journal is not a directory, must be using persistent logging for FSS."); @@ -159,7 +159,7 @@ int action_setup_keys(void) { if (r < 0) return log_error_errno(r, "Failed to write state: %m"); - r = link_tmpfile(fd, tmpfile, path, /* flags= */ 0); + r = link_tmpfile(fd, tmpfile, path, /* flags = */ 0); if (r < 0) return log_error_errno(r, "Failed to link file: %m"); @@ -200,7 +200,7 @@ int action_setup_keys(void) { if (r < 0) return log_error_errno(r, "Failed to build json object: %m"); - r = sd_json_variant_dump(v, arg_json_format_flags, /* f= */ NULL, /* prefix= */ NULL); + r = sd_json_variant_dump(v, arg_json_format_flags, /* f = */ NULL, /* prefix = */ NULL); if (r < 0) return log_error_errno(r, "Failed to dump json object: %m"); diff --git a/src/journal/journalctl-catalog.c b/src/journal/journalctl-catalog.c index cc5b93623b7..0481dd51301 100644 --- a/src/journal/journalctl-catalog.c +++ b/src/journal/journalctl-catalog.c @@ -46,9 +46,9 @@ int action_list_catalog(char **items) { pager_open(arg_pager_flags); if (items) - r = catalog_list_items(/* f= */ NULL, database, oneline, items); + r = catalog_list_items(/* f = */ NULL, database, oneline, items); else - r = catalog_list(/* f= */ NULL, database, oneline); + r = catalog_list(/* f = */ NULL, database, oneline); if (r < 0) return log_error_errno(r, "Failed to list catalog: %m"); diff --git a/src/journal/journalctl-misc.c b/src/journal/journalctl-misc.c index 78d3cae91ac..e7c861b6b28 100644 --- a/src/journal/journalctl-misc.c +++ b/src/journal/journalctl-misc.c @@ -55,7 +55,7 @@ int action_verify(void) { log_notice("Journal file %s has sealing enabled but verification key has not been passed using --verify-key=.", f->path); #endif - k = journal_file_verify(f, arg_verify_key, &first, &validated, &last, /* show_progress= */ !arg_quiet); + k = journal_file_verify(f, arg_verify_key, &first, &validated, &last, /* show_progress = */ !arg_quiet); if (k == -EINVAL) /* If the key was invalid give up right-away. */ return k; @@ -172,8 +172,8 @@ int action_list_boots(void) { r = journal_get_boots( j, - /* advance_older= */ arg_lines_needs_seek_end(), - /* max_ids= */ arg_lines >= 0 ? (size_t) arg_lines : SIZE_MAX, + /* advance_older = */ arg_lines_needs_seek_end(), + /* max_ids = */ arg_lines >= 0 ? (size_t) arg_lines : SIZE_MAX, &ids, &n_ids); if (r < 0) return log_error_errno(r, "Failed to determine boots: %m"); @@ -267,9 +267,9 @@ int action_list_invocations(void) { r = journal_get_log_ids( j, type, - /* boot_id= */ arg_boot_id, /* unit= */ unit, - /* advance_older= */ arg_lines_needs_seek_end(), - /* max_ids= */ arg_lines >= 0 ? (size_t) arg_lines : SIZE_MAX, + /* boot_id = */ arg_boot_id, /* unit = */ unit, + /* advance_older = */ arg_lines_needs_seek_end(), + /* max_ids = */ arg_lines >= 0 ? (size_t) arg_lines : SIZE_MAX, &ids, &n_ids); if (r < 0) return log_error_errno(r, "Failed to list invocation id for %s: %m", unit); diff --git a/src/journal/journalctl-show.c b/src/journal/journalctl-show.c index 0fa919cfd26..4ebedb092e8 100644 --- a/src/journal/journalctl-show.c +++ b/src/journal/journalctl-show.c @@ -460,12 +460,12 @@ static int setup_event(Context *c, int fd) { (void) sd_event_add_signal(e, /* ret= */ NULL, SIGTERM | SD_EVENT_SIGNAL_PROCMASK, on_signal, c); (void) sd_event_add_signal(e, /* ret= */ NULL, SIGINT | SD_EVENT_SIGNAL_PROCMASK, on_signal, c); - r = sd_event_add_io(e, /* ret= */ NULL, fd, EPOLLIN, &on_journal_event, c); + r = sd_event_add_io(e, /* ret = */ NULL, fd, EPOLLIN, &on_journal_event, c); if (r < 0) return log_error_errno(r, "Failed to add io event source for journal: %m"); /* Also keeps an eye on STDOUT, and exits as soon as we see a POLLHUP on that, i.e. when it is closed. */ - r = sd_event_add_io(e, /* ret= */ NULL, STDOUT_FILENO, EPOLLHUP|EPOLLERR, /* callback= */ NULL, /* userdata= */ NULL); + r = sd_event_add_io(e, /* ret = */ NULL, STDOUT_FILENO, EPOLLHUP|EPOLLERR, /* callback = */ NULL, /* userdata = */ NULL); if (r == -EPERM) /* Installing an epoll watch on a regular file doesn't work and fails with EPERM. Which is * totally OK, handle it gracefully. epoll_ctl() documents EPERM as the error returned when diff --git a/src/journal/journald-config.c b/src/journal/journald-config.c index 045b06a8723..b524379b5c4 100644 --- a/src/journal/journald-config.c +++ b/src/journal/journald-config.c @@ -317,7 +317,7 @@ static void manager_load_credentials(JournalConfig *c) { assert(c); - r = read_credential("journal.forward_to_socket", (void**) &data, /* ret_size= */ NULL); + r = read_credential("journal.forward_to_socket", (void**) &data, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential 'journal.forward_to_socket', ignoring: %m"); else { @@ -328,7 +328,7 @@ static void manager_load_credentials(JournalConfig *c) { data = mfree(data); - r = read_credential("journal.storage", (void**) &data, /* ret_size= */ NULL); + r = read_credential("journal.storage", (void**) &data, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential journal.storage, ignoring: %m"); else { @@ -384,7 +384,7 @@ int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_sig manager_reopen_journals(m, &old); log_info("Config file reloaded."); - (void) sd_notify(/* unset_environment= */ false, NOTIFY_READY_MESSAGE); + (void) sd_notify(/* unset_environment = */ false, NOTIFY_READY_MESSAGE); return 0; } diff --git a/src/journal/journald-manager.c b/src/journal/journald-manager.c index 8ed31f0061d..e1e9cba0ed6 100644 --- a/src/journal/journald-manager.c +++ b/src/journal/journald-manager.c @@ -958,7 +958,7 @@ static void manager_write_to_journal( log_ratelimit_info(JOURNAL_LOG_RATELIMIT, "Time jumped backwards, rotating."); manager_rotate(m); - manager_vacuum(m, /* verbose= */ false); + manager_vacuum(m, /* verbose = */ false); vacuumed = true; } @@ -976,7 +976,7 @@ static void manager_write_to_journal( log_debug("%s: Journal header limits reached or header out-of-date, rotating.", f->path); manager_rotate_journal(m, TAKE_PTR(f), uid); - manager_vacuum(m, /* verbose= */ false); + manager_vacuum(m, /* verbose = */ false); vacuumed = true; f = manager_find_journal(m, uid); @@ -1011,7 +1011,7 @@ static void manager_write_to_journal( } manager_rotate_journal(m, TAKE_PTR(f), uid); - manager_vacuum(m, /* verbose= */ false); + manager_vacuum(m, /* verbose = */ false); f = manager_find_journal(m, uid); if (!f) @@ -1319,7 +1319,7 @@ int manager_flush_to_var(Manager *m, bool require_flag_file) { if (require_flag_file && !manager_flushed_flag_is_set(m)) return 0; - (void) manager_system_journal_open(m, /* flush_requested= */ true, /* relinquish_requested= */ false); + (void) manager_system_journal_open(m, /* flush_requested=*/ true, /* relinquish_requested= */ false); if (!m->system_journal) return 0; @@ -1376,8 +1376,8 @@ int manager_flush_to_var(Manager *m, bool require_flag_file) { log_ratelimit_info(JOURNAL_LOG_RATELIMIT, "Rotating system journal."); - manager_rotate_journal(m, m->system_journal, /* uid= */ 0); - manager_vacuum(m, /* verbose= */ false); + manager_rotate_journal(m, m->system_journal, /* uid = */ 0); + manager_vacuum(m, /* verbose = */ false); if (!m->system_journal) { log_ratelimit_notice(JOURNAL_LOG_RATELIMIT, @@ -1466,7 +1466,7 @@ int manager_relinquish_var(Manager *m) { log_debug("Relinquishing %s...", m->system_storage.path); - (void) manager_system_journal_open(m, /* flush_requested= */ false, /* relinquish_requested= */ true); + (void) manager_system_journal_open(m, /* flush_requested = */ false, /* relinquish_requested = */ true); m->system_journal = journal_file_offline_close(m->system_journal); ordered_hashmap_clear(m->user_journals); @@ -1624,7 +1624,7 @@ void manager_full_flush(Manager *m) { assert(m); (void) manager_flush_to_var(m, false); - manager_sync(m, /* wait= */ false); + manager_sync(m, /* wait = */ false); manager_vacuum(m, false); manager_space_usage_message(m, NULL); @@ -1794,7 +1794,7 @@ static int dispatch_sigrtmin1(sd_event_source *es, const struct signalfd_siginfo } log_debug("Received SIGRTMIN1 signal from PID %u, as request to sync.", si->ssi_pid); - manager_full_sync(m, /* wait= */ false); + manager_full_sync(m, /* wait = */ false); return 0; } @@ -1856,7 +1856,7 @@ static int manager_setup_signals(Manager *m) { static int manager_dispatch_sync(sd_event_source *es, usec_t t, void *userdata) { Manager *m = ASSERT_PTR(userdata); - manager_sync(m, /* wait= */ false); + manager_sync(m, /* wait = */ false); return 0; } @@ -1867,13 +1867,13 @@ static int manager_schedule_sync(Manager *m, int priority) { if (priority <= LOG_CRIT) { /* Immediately sync to disk when this is of priority CRIT, ALERT, EMERG */ - manager_sync(m, /* wait= */ false); + manager_sync(m, /* wait = */ false); return 0; } if (!m->event || sd_event_get_state(m->event) == SD_EVENT_FINISHED) { /* Shutting down the server? Let's sync immediately. */ - manager_sync(m, /* wait= */ false); + manager_sync(m, /* wait = */ false); return 0; } @@ -2286,12 +2286,12 @@ void manager_reopen_journals(Manager *m, const JournalConfig *old) { ordered_hashmap_clear(m->user_journals); set_clear(m->deferred_closes); - (void) manager_system_journal_open(m, /* flush_requested= */ false, /* relinquish_requested= */ false); + (void) manager_system_journal_open(m, /* flush_requested = */ false, /* relinquish_requested = */ false); /* To make the storage related settings applied, vacuum the storage. */ cache_space_invalidate(&m->system_storage.space); cache_space_invalidate(&m->runtime_storage.space); - manager_vacuum(m, /* verbose= */ false); + manager_vacuum(m, /* verbose = */ false); } int manager_new(Manager **ret) { diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c index 00b1fa2e423..227b5cba830 100644 --- a/src/journal/journald-stream.c +++ b/src/journal/journald-stream.c @@ -572,7 +572,7 @@ static int stdout_stream_process(sd_event_source *es, int fd, uint32_t revents, cmsg_close_all(&msghdr); if (l == 0) { - (void) stdout_stream_scan(s, s->buffer, s->length, /* force_flush= */ LINE_BREAK_EOF, NULL); + (void) stdout_stream_scan(s, s->buffer, s->length, /* force_flush = */ LINE_BREAK_EOF, NULL); goto terminate; } @@ -583,7 +583,7 @@ static int stdout_stream_process(sd_event_source *es, int fd, uint32_t revents, if (ucred && ucred->pid != s->ucred.pid) { /* Force out any previously half-written lines from a different process, before we switch to * the new ucred structure for everything we just added */ - r = stdout_stream_scan(s, s->buffer, s->length, /* force_flush= */ LINE_BREAK_PID_CHANGE, NULL); + r = stdout_stream_scan(s, s->buffer, s->length, /* force_flush = */ LINE_BREAK_PID_CHANGE, NULL); if (r < 0) goto terminate; diff --git a/src/journal/journald-varlink.c b/src/journal/journald-varlink.c index 6ea293791dd..720c3628f1a 100644 --- a/src/journal/journald-varlink.c +++ b/src/journal/journald-varlink.c @@ -20,7 +20,7 @@ void sync_req_varlink_reply(SyncReq *req) { * anymore. */ if (req->offline) - manager_full_sync(req->manager, /* wait= */ true); + manager_full_sync(req->manager, /* wait = */ true); log_debug("Client request to sync journal (%s offlining) completed.", req->offline ? "with" : "without"); @@ -88,7 +88,7 @@ static int vl_method_rotate(sd_varlink *link, sd_json_variant *parameters, sd_va assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -109,7 +109,7 @@ static int vl_method_flush_to_var(sd_varlink *link, sd_json_variant *parameters, assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -133,7 +133,7 @@ static int vl_method_relinquish_var(sd_varlink *link, sd_json_variant *parameter assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/journal/journald.c b/src/journal/journald.c index a06752d32e5..e7ed6a556c9 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -66,8 +66,8 @@ static int run(int argc, char *argv[]) { if (r < 0) return r; - manager_vacuum(m, /* verbose= */ false); - manager_flush_to_var(m, /* require_flag_file= */ true); + manager_vacuum(m, /* verbose = */ false); + manager_flush_to_var(m, /* require_flag_file = */ true); manager_flush_dev_kmsg(m); if (m->namespace) @@ -104,7 +104,7 @@ static int run(int argc, char *argv[]) { /* The retention time is reached, so let's vacuum! */ if (t <= 0) { log_info("Retention time reached, vacuuming."); - manager_vacuum(m, /* verbose= */ false); + manager_vacuum(m, /* verbose = */ false); continue; } } else diff --git a/src/kernel-install/kernel-install.c b/src/kernel-install/kernel-install.c index a9b148d98c5..27cfa089089 100644 --- a/src/kernel-install/kernel-install.c +++ b/src/kernel-install/kernel-install.c @@ -336,7 +336,7 @@ static int context_set_path(Context *c, const char *s, const char *source, const return 0; if (c->rfd >= 0) { - r = chaseat(c->rfd, s, CHASE_AT_RESOLVE_IN_ROOT, &p, /* ret_fd= */ NULL); + r = chaseat(c->rfd, s, CHASE_AT_RESOLVE_IN_ROOT, &p, /* ret_fd = */ NULL); if (r < 0) return log_warning_errno(r, "Failed to chase path %s for %s specified via %s, ignoring: %m", s, name, source); @@ -384,7 +384,7 @@ static int context_set_path_strv(Context *c, char* const* strv, const char *sour char *p; if (c->rfd >= 0) { - r = chaseat(c->rfd, *s, CHASE_AT_RESOLVE_IN_ROOT, &p, /* ret_fd= */ NULL); + r = chaseat(c->rfd, *s, CHASE_AT_RESOLVE_IN_ROOT, &p, /* ret_fd = */ NULL); if (r < 0) return log_warning_errno(r, "Failed to chase path %s for %s specified via %s: %m", *s, name, source); @@ -567,12 +567,12 @@ static int context_acquire_xbootldr(Context *c) { assert(!c->boot_root); r = find_xbootldr_and_warn_at( - /* rfd= */ c->rfd, - /* path= */ arg_xbootldr_path, + /* rfd = */ c->rfd, + /* path = */ arg_xbootldr_path, /* unprivileged_mode= */ -1, - /* ret_path= */ &c->boot_root, - /* ret_uuid= */ NULL, - /* ret_devid= */ NULL); + /* ret_path = */ &c->boot_root, + /* ret_uuid = */ NULL, + /* ret_devid = */ NULL); if (r == -ENOKEY) { log_debug_errno(r, "Couldn't find an XBOOTLDR partition."); return 0; @@ -593,15 +593,15 @@ static int context_acquire_esp(Context *c) { assert(!c->boot_root); r = find_esp_and_warn_at( - /* rfd= */ c->rfd, - /* path= */ arg_esp_path, + /* rfd = */ c->rfd, + /* path = */ arg_esp_path, /* unprivileged_mode= */ -1, - /* ret_path= */ &c->boot_root, - /* ret_part= */ NULL, - /* ret_pstart= */ NULL, - /* ret_psize= */ NULL, - /* ret_uuid= */ NULL, - /* ret_devid= */ NULL); + /* ret_path = */ &c->boot_root, + /* ret_part = */ NULL, + /* ret_pstart = */ NULL, + /* ret_psize = */ NULL, + /* ret_uuid = */ NULL, + /* ret_devid = */ NULL); if (r == -ENOKEY) { log_debug_errno(r, "Couldn't find EFI system partition, ignoring."); return 0; @@ -636,7 +636,7 @@ static int context_ensure_boot_root(Context *c) { /* If all else fails, use /boot. */ if (c->rfd >= 0) { - r = chaseat(c->rfd, "/boot", CHASE_AT_RESOLVE_IN_ROOT, &c->boot_root, /* ret_fd= */ NULL); + r = chaseat(c->rfd, "/boot", CHASE_AT_RESOLVE_IN_ROOT, &c->boot_root, /* ret_fd = */ NULL); if (r < 0) return log_error_errno(r, "Failed to chase '/boot/': %m"); } else { @@ -789,7 +789,7 @@ static int context_ensure_layout(Context *c) { if (!entry_token_path) return log_oom(); - r = is_dir_at(c->rfd, entry_token_path, /* follow= */ false); + r = is_dir_at(c->rfd, entry_token_path, /* follow = */ false); if (r < 0 && r != -ENOENT) return log_error_errno(r, "Failed to check if '%s' is a directory: %m", entry_token_path); if (r > 0) { @@ -969,7 +969,7 @@ static int context_build_arguments(Context *c) { if (r < 0) return log_oom(); - r = strv_extend_strv(&a, c->initrds, /* filter_duplicates= */ false); + r = strv_extend_strv(&a, c->initrds, /* filter_duplicates = */ false); if (r < 0) return log_oom(); @@ -1056,10 +1056,10 @@ static int context_execute(Context *c) { return r; if (DEBUG_LOGGING) { - _cleanup_free_ char *x = strv_join_full(c->plugins, "", "\n ", /* escape_separator= */ false); + _cleanup_free_ char *x = strv_join_full(c->plugins, "", "\n ", /* escape_separator = */ false); log_debug("Using plugins: %s", strna(x)); - _cleanup_free_ char *y = strv_join_full(c->envp, "", "\n ", /* escape_separator= */ false); + _cleanup_free_ char *y = strv_join_full(c->envp, "", "\n ", /* escape_separator = */ false); log_debug("Plugin environment: %s", strna(y)); _cleanup_free_ char *z = strv_join(strv_skip(c->argv, 1), " "); @@ -1069,10 +1069,10 @@ static int context_execute(Context *c) { ret = execute_strv( "plugins", c->plugins, - /* root= */ NULL, + /* root = */ NULL, USEC_INFINITY, - /* callbacks= */ NULL, - /* callback_args= */ NULL, + /* callbacks = */ NULL, + /* callback_args = */ NULL, c->argv, c->envp, EXEC_DIR_SKIP_REMAINING); @@ -1586,13 +1586,13 @@ static int parse_argv(int argc, char *argv[], Context *c) { break; case ARG_ESP_PATH: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_esp_path); + r = parse_path_argument(optarg, /* suppress_root = */ false, &arg_esp_path); if (r < 0) return log_oom(); break; case ARG_BOOT_PATH: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_xbootldr_path); + r = parse_path_argument(optarg, /* suppress_root = */ false, &arg_xbootldr_path); if (r < 0) return log_oom(); break; diff --git a/src/keyutil/keyutil.c b/src/keyutil/keyutil.c index 1c283d2aa7f..f19718a11f2 100644 --- a/src/keyutil/keyutil.c +++ b/src/keyutil/keyutil.c @@ -155,14 +155,14 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_SIGNATURE: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_signature); + r = parse_path_argument(optarg, /*suppress_root=*/ false, &arg_signature); if (r < 0) return r; break; case ARG_CONTENT: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_content); + r = parse_path_argument(optarg, /*suppress_root=*/ false, &arg_content); if (r < 0) return r; @@ -173,7 +173,7 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_OUTPUT: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_output); + r = parse_path_argument(optarg, /*suppress_root=*/ false, &arg_output); if (r < 0) return r; @@ -207,7 +207,7 @@ static int verb_validate(int argc, char *argv[], void *userdata) { "No private key specified, use --private-key=."); if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } @@ -255,7 +255,7 @@ static int verb_public(int argc, char *argv[], void *userdata) { _cleanup_(X509_freep) X509 *certificate = NULL; if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } @@ -330,7 +330,7 @@ static int verb_pkcs7(int argc, char *argv[], void *userdata) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--output= must be specified"); if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 751aed78a7f..4eef68fa3b3 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -613,8 +613,8 @@ static int dhcp6_option_parse_ia_address(sd_dhcp6_client *client, DHCP6IA *ia, c memcpy(&a->iaaddr, data, sizeof(struct iaaddr)); - lt_valid = be32_sec_to_usec(a->iaaddr.lifetime_valid, /* max_as_infinity= */ true); - lt_pref = be32_sec_to_usec(a->iaaddr.lifetime_preferred, /* max_as_infinity= */ true); + lt_valid = be32_sec_to_usec(a->iaaddr.lifetime_valid, /* max_as_infinity = */ true); + lt_pref = be32_sec_to_usec(a->iaaddr.lifetime_preferred, /* max_as_infinity = */ true); if (lt_valid == 0) return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), @@ -657,8 +657,8 @@ static int dhcp6_option_parse_ia_pdprefix(sd_dhcp6_client *client, DHCP6IA *ia, memcpy(&a->iapdprefix, data, sizeof(struct iapdprefix)); - lt_valid = be32_sec_to_usec(a->iapdprefix.lifetime_valid, /* max_as_infinity= */ true); - lt_pref = be32_sec_to_usec(a->iapdprefix.lifetime_preferred, /* max_as_infinity= */ true); + lt_valid = be32_sec_to_usec(a->iapdprefix.lifetime_valid, /* max_as_infinity = */ true); + lt_pref = be32_sec_to_usec(a->iapdprefix.lifetime_preferred, /* max_as_infinity = */ true); if (lt_valid == 0) return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), @@ -739,8 +739,8 @@ int dhcp6_option_parse_ia( "from the one chosen by the client, ignoring."); /* It is not necessary to check if the lifetime_t2 is zero here, as in that case it will be updated later. */ - lt_t1 = be32_sec_to_usec(ia->header.lifetime_t1, /* max_as_infinity= */ true); - lt_t2 = be32_sec_to_usec(ia->header.lifetime_t2, /* max_as_infinity= */ true); + lt_t1 = be32_sec_to_usec(ia->header.lifetime_t1, /* max_as_infinity = */ true); + lt_t2 = be32_sec_to_usec(ia->header.lifetime_t2, /* max_as_infinity = */ true); if (lt_t1 > lt_t2) return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), diff --git a/src/libsystemd-network/fuzz-dhcp-server.c b/src/libsystemd-network/fuzz-dhcp-server.c index bcd8af629ed..f20d993941f 100644 --- a/src/libsystemd-network/fuzz-dhcp-server.c +++ b/src/libsystemd-network/fuzz-dhcp-server.c @@ -42,7 +42,7 @@ static int add_lease(sd_dhcp_server *server, const struct in_addr *server_addres lease->client_id.raw[0] = 2; lease->client_id.raw[1] = i; - r = dhcp_server_put_lease(server, lease, /* is_static= */ false); + r = dhcp_server_put_lease(server, lease, /* is_static = */ false); if (r < 0) return r; diff --git a/src/libsystemd-network/fuzz-ndisc-rs.c b/src/libsystemd-network/fuzz-ndisc-rs.c index fc7c21103c8..0576821666e 100644 --- a/src/libsystemd-network/fuzz-ndisc-rs.c +++ b/src/libsystemd-network/fuzz-ndisc-rs.c @@ -71,7 +71,7 @@ static void test_with_icmp6_packet(const uint8_t *data, size_t size) { return; if (ndisc_send(fd_pair[1], &IN6_ADDR_ALL_ROUTERS_MULTICAST, - icmp6_packet_get_header(packet), options, /* timestamp= */ 0) < 0) + icmp6_packet_get_header(packet), options, /* timestamp = */ 0) < 0) return; packet = icmp6_packet_unref(packet); diff --git a/src/libsystemd-network/ndisc-option.c b/src/libsystemd-network/ndisc-option.c index 0104515cb0c..c61543fef86 100644 --- a/src/libsystemd-network/ndisc-option.c +++ b/src/libsystemd-network/ndisc-option.c @@ -406,8 +406,8 @@ static int ndisc_option_parse_prefix(Set **options, size_t offset, size_t len, c if (pi->nd_opt_pi_type != SD_NDISC_OPTION_PREFIX_INFORMATION) return -EBADMSG; - usec_t valid = be32_sec_to_usec(pi->nd_opt_pi_valid_time, /* max_as_infinity= */ true); - usec_t pref = be32_sec_to_usec(pi->nd_opt_pi_preferred_time, /* max_as_infinity= */ true); + usec_t valid = be32_sec_to_usec(pi->nd_opt_pi_valid_time, /* max_as_infinity = */ true); + usec_t pref = be32_sec_to_usec(pi->nd_opt_pi_preferred_time, /* max_as_infinity = */ true); /* We only support 64 bits interface identifier for addrconf. */ uint8_t flags = pi->nd_opt_pi_flags_reserved; @@ -627,7 +627,7 @@ static int ndisc_option_parse_home_agent(Set **options, size_t offset, size_t le return ndisc_option_add_home_agent( options, offset, be16toh(p->nd_opt_home_agent_info_preference), - be16_sec_to_usec(p->nd_opt_home_agent_info_lifetime, /* max_as_infinity= */ false)); + be16_sec_to_usec(p->nd_opt_home_agent_info_lifetime, /* max_as_infinity = */ false)); } static int ndisc_option_build_home_agent(const sd_ndisc_option *option, usec_t timestamp, uint8_t **ret) { @@ -731,7 +731,7 @@ static int ndisc_option_parse_route(Set **options, size_t offset, size_t len, co return -EBADMSG; uint8_t preference = (opt[3] >> 3) & 0x03; - usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity= */ true); + usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity = */ true); struct in6_addr prefix; memcpy_safe(&prefix, opt + 8, len - 8); @@ -807,7 +807,7 @@ static int ndisc_option_parse_rdnss(Set **options, size_t offset, size_t len, co if (opt[0] != SD_NDISC_OPTION_RDNSS) return -EBADMSG; - usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity= */ true); + usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity = */ true); size_t n_addrs = len / sizeof(struct in6_addr); return ndisc_option_add_rdnss(options, offset, n_addrs, (const struct in6_addr*) (opt + 8), lifetime); @@ -944,7 +944,7 @@ static int ndisc_option_parse_dnssl(Set **options, size_t offset, size_t len, co if (opt[0] != SD_NDISC_OPTION_DNSSL) return -EBADMSG; - usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity= */ true); + usec_t lifetime = unaligned_be32_sec_to_usec(opt + 4, /* max_as_infinity = */ true); _cleanup_strv_free_ char **l = NULL; _cleanup_free_ char *e = NULL; @@ -1032,7 +1032,7 @@ static int ndisc_option_parse_dnssl(Set **options, size_t offset, size_t len, co uint8_t *p = buf + 8; STRV_FOREACH(s, option->dnssl.domains) { - r = dns_name_to_wire_format(*s, p, remaining, /* canonical= */ false); + r = dns_name_to_wire_format(*s, p, remaining, /* canonical = */ false); if (r < 0) return r; @@ -1330,7 +1330,7 @@ static int ndisc_option_parse_encrypted_dns(Set **options, size_t offset, size_t off += sizeof(uint16_t); /* Lifetime */ - lifetime = unaligned_be32_sec_to_usec(opt + off, /* max_as_infinity= */ true); + lifetime = unaligned_be32_sec_to_usec(opt + off, /* max_as_infinity = */ true); off += sizeof(uint32_t); /* adn field (length + dns-name) */ @@ -1451,7 +1451,7 @@ static int ndisc_option_build_encrypted_dns(const sd_ndisc_option *option, usec_ if (!GREEDY_REALLOC(buf, off + sizeof(uint16_t) + ilen)) return -ENOMEM; - r = dns_name_to_wire_format(res->auth_name, buf + off + sizeof(uint16_t), ilen, /* canonical= */ false); + r = dns_name_to_wire_format(res->auth_name, buf + off + sizeof(uint16_t), ilen, /* canonical = */ false); if (r < 0) return r; unaligned_write_be16(buf + off, (uint16_t) r); diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 48215e6d21f..f77d3f696c8 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -357,7 +357,7 @@ static int dhcp_client_set_iaid_duid( if (!iaid_set) { r = dhcp_identifier_set_iaid(client->dev, &client->hw_addr, - /* legacy_unstable_byteorder= */ true, + /* legacy_unstable_byteorder = */ true, &iaid); if (r < 0) return r; @@ -1628,7 +1628,7 @@ static int bootp_option_parse_and_verify( assert(message); assert(lease); - r = dhcp_option_parse(message, len, dhcp_lease_parse_options, lease, /* ret_error_message= */ NULL); + r = dhcp_option_parse(message, len, dhcp_lease_parse_options, lease, /* ret_error_message = */ NULL); if (r == -ENOMSG) r = DHCP_ACK; /* BOOTP messages don't have a DHCP message type option */ else if (r < 0) @@ -1741,7 +1741,7 @@ static int client_enter_requesting_now(sd_dhcp_client *client) { CLOCK_BOOTTIME, 0, 0, client_timeout_resend, client, client->event_priority, "dhcp4-resend-timer", - /* force_reset= */ true); + /* force_reset = */ true); } static int client_enter_requesting_delayed(sd_event_source *s, uint64_t usec, void *userdata) { @@ -1778,7 +1778,7 @@ static int client_enter_requesting(sd_dhcp_client *client) { client->lease->ipv6_only_preferred_usec, 0, client_enter_requesting_delayed, client, client->event_priority, "dhcp4-ipv6-only-mode-timer", - /* force_reset= */ true); + /* force_reset = */ true); } return client_enter_requesting_now(client); @@ -2031,7 +2031,7 @@ static int client_enter_bound(sd_dhcp_client *client, int notify_event) { client->lease->ipv6_only_preferred_usec, 0, client_enter_bound_delayed, client, client->event_priority, "dhcp4-ipv6-only-mode", - /* force_reset= */ true); + /* force_reset = */ true); } return client_enter_bound_now(client, notify_event); @@ -2322,7 +2322,7 @@ int sd_dhcp_client_start(sd_dhcp_client *client) { /* If no client identifier exists, construct an RFC 4361-compliant one */ if (!sd_dhcp_client_id_is_set(&client->client_id)) { - r = sd_dhcp_client_set_iaid_duid_en(client, /* iaid_set= */ false, /* iaid= */ 0); + r = sd_dhcp_client_set_iaid_duid_en(client, /* iaid_set = */ false, /* iaid = */ 0); if (r < 0) return r; } diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index efded5df010..9f89f7bdafe 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -903,7 +903,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void switch (code) { case SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME: - r = lease_parse_be32_seconds(option, len, /* max_as_infinity= */ true, &lease->lifetime); + r = lease_parse_be32_seconds(option, len, /* max_as_infinity = */ true, &lease->lifetime); if (r < 0) log_debug_errno(r, "Failed to parse lease time, ignoring: %m"); @@ -1047,13 +1047,13 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void break; } case SD_DHCP_OPTION_RENEWAL_TIME: - r = lease_parse_be32_seconds(option, len, /* max_as_infinity= */ true, &lease->t1); + r = lease_parse_be32_seconds(option, len, /* max_as_infinity = */ true, &lease->t1); if (r < 0) log_debug_errno(r, "Failed to parse T1 time, ignoring: %m"); break; case SD_DHCP_OPTION_REBINDING_TIME: - r = lease_parse_be32_seconds(option, len, /* max_as_infinity= */ true, &lease->t2); + r = lease_parse_be32_seconds(option, len, /* max_as_infinity = */ true, &lease->t2); if (r < 0) log_debug_errno(r, "Failed to parse T2 time, ignoring: %m"); break; @@ -1116,7 +1116,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void break; case SD_DHCP_OPTION_IPV6_ONLY_PREFERRED: - r = lease_parse_be32_seconds(option, len, /* max_as_infinity= */ false, &lease->ipv6_only_preferred_usec); + r = lease_parse_be32_seconds(option, len, /* max_as_infinity = */ false, &lease->ipv6_only_preferred_usec); if (r < 0) log_debug_errno(r, "Failed to parse IPv6 only preferred option, ignoring: %m"); diff --git a/src/libsystemd-network/sd-dhcp-server-lease.c b/src/libsystemd-network/sd-dhcp-server-lease.c index b8807391bdc..68b3ac5bccd 100644 --- a/src/libsystemd-network/sd-dhcp-server-lease.c +++ b/src/libsystemd-network/sd-dhcp-server-lease.c @@ -116,7 +116,7 @@ int dhcp_server_set_lease(sd_dhcp_server *server, be32_t address, DHCPRequest *r return -ENOMEM; } - r = dhcp_server_put_lease(server, lease, /* is_static= */ false); + r = dhcp_server_put_lease(server, lease, /* is_static = */ false); if (r < 0) return r; @@ -159,7 +159,7 @@ sd_dhcp_server_lease* dhcp_server_get_static_lease(sd_dhcp_server *server, const if (!client_id_data_size_is_valid(req->message->hlen)) return NULL; - if (sd_dhcp_client_id_set(&client_id, /* type= */ 1, req->message->chaddr, req->message->hlen) < 0) + if (sd_dhcp_client_id_set(&client_id, /* type = */ 1, req->message->chaddr, req->message->hlen) < 0) return NULL; static_lease = hashmap_get(server->static_leases_by_client_id, &client_id); @@ -229,7 +229,7 @@ int sd_dhcp_server_set_static_lease( return -ENOMEM; } - r = dhcp_server_put_lease(server, lease, /* is_static= */ true); + r = dhcp_server_put_lease(server, lease, /* is_static = */ true); if (r < 0) return r; @@ -361,7 +361,7 @@ int dhcp_server_save_leases(sd_dhcp_server *server) { (void) fchmod(fileno(f), 0644); - r = sd_json_variant_dump(v, SD_JSON_FORMAT_NEWLINE | SD_JSON_FORMAT_FLUSH, f, /* prefix= */ NULL); + r = sd_json_variant_dump(v, SD_JSON_FORMAT_NEWLINE | SD_JSON_FORMAT_FLUSH, f, /* prefix = */ NULL); if (r < 0) goto failure; @@ -372,7 +372,7 @@ int dhcp_server_save_leases(sd_dhcp_server *server) { return 0; failure: - (void) unlinkat(server->lease_dir_fd, temp_path, /* flags= */ 0); + (void) unlinkat(server->lease_dir_fd, temp_path, /* flags = */ 0); return r; } @@ -454,7 +454,7 @@ static int json_dispatch_dhcp_lease(sd_dhcp_server *server, sd_json_variant *v, lease->expiration = map_clock_usec_raw(lease->expiration, now_r, now_b); } - r = dhcp_server_put_lease(server, lease, /* is_static= */ false); + r = dhcp_server_put_lease(server, lease, /* is_static = */ false); if (r == -EEXIST) return 0; if (r < 0) @@ -487,13 +487,13 @@ static int load_leases_file(int dir_fd, const char *path, SavedInfo *ret) { assert(ret); r = sd_json_parse_file_at( - /* f= */ NULL, + /* f = */ NULL, dir_fd, path, - /* flags= */ 0, + /* flags = */ 0, &v, - /* reterr_line= */ NULL, - /* ret_column= */ NULL); + /* reterr_line = */ NULL, + /* ret_column = */ NULL); if (r < 0) return r; @@ -534,7 +534,7 @@ int dhcp_server_load_leases(sd_dhcp_server *server) { sd_json_variant *i; JSON_VARIANT_ARRAY_FOREACH(i, info.leases) - RET_GATHER(r, json_dispatch_dhcp_lease(server, i, /* use_boottime= */ sd_id128_equal(info.boot_id, boot_id))); + RET_GATHER(r, json_dispatch_dhcp_lease(server, i, /* use_boottime = */ sd_id128_equal(info.boot_id, boot_id))); m = hashmap_size(server->bound_leases_by_client_id); assert(m >= n); diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index d1fe0e22732..c86e4e0e0c1 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -807,7 +807,7 @@ static int parse_request(uint8_t code, uint8_t len, const void *option, void *us switch (code) { case SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME: if (len == 4) - req->lifetime = unaligned_be32_sec_to_usec(option, /* max_as_infinity= */ true); + req->lifetime = unaligned_be32_sec_to_usec(option, /* max_as_infinity = */ true); break; case SD_DHCP_OPTION_REQUESTED_IP_ADDRESS: @@ -884,7 +884,7 @@ static int ensure_sane_request(sd_dhcp_server *server, DHCPRequest *req, DHCPMes if (!client_id_data_size_is_valid(message->hlen)) return -EBADMSG; - r = sd_dhcp_client_id_set(&req->client_id, /* type= */ 1, message->chaddr, message->hlen); + r = sd_dhcp_client_id_set(&req->client_id, /* type = */ 1, message->chaddr, message->hlen); if (r < 0) return r; } diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 448a2e7557e..36585c85543 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -321,7 +321,7 @@ static int client_ensure_iaid(sd_dhcp6_client *client) { return 0; r = dhcp_identifier_set_iaid(client->dev, &client->hw_addr, - /* legacy_unstable_byteorder= */ true, + /* legacy_unstable_byteorder = */ true, &iaid); if (r < 0) return r; diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index 835f6c2d653..278962808a1 100644 --- a/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libsystemd-network/sd-dhcp6-lease.c @@ -49,19 +49,19 @@ static void dhcp6_lease_set_lifetime(sd_dhcp6_lease *lease) { assert(lease->ia_na || lease->ia_pd); if (lease->ia_na) { - t1 = MIN(t1, be32_sec_to_usec(lease->ia_na->header.lifetime_t1, /* max_as_infinity= */ true)); - t2 = MIN(t2, be32_sec_to_usec(lease->ia_na->header.lifetime_t2, /* max_as_infinity= */ true)); + t1 = MIN(t1, be32_sec_to_usec(lease->ia_na->header.lifetime_t1, /* max_as_infinity = */ true)); + t2 = MIN(t2, be32_sec_to_usec(lease->ia_na->header.lifetime_t2, /* max_as_infinity = */ true)); LIST_FOREACH(addresses, a, lease->ia_na->addresses) - min_valid_lt = MIN(min_valid_lt, be32_sec_to_usec(a->iaaddr.lifetime_valid, /* max_as_infinity= */ true)); + min_valid_lt = MIN(min_valid_lt, be32_sec_to_usec(a->iaaddr.lifetime_valid, /* max_as_infinity = */ true)); } if (lease->ia_pd) { - t1 = MIN(t1, be32_sec_to_usec(lease->ia_pd->header.lifetime_t1, /* max_as_infinity= */ true)); - t2 = MIN(t2, be32_sec_to_usec(lease->ia_pd->header.lifetime_t2, /* max_as_infinity= */ true)); + t1 = MIN(t1, be32_sec_to_usec(lease->ia_pd->header.lifetime_t1, /* max_as_infinity = */ true)); + t2 = MIN(t2, be32_sec_to_usec(lease->ia_pd->header.lifetime_t2, /* max_as_infinity = */ true)); LIST_FOREACH(addresses, a, lease->ia_pd->addresses) - min_valid_lt = MIN(min_valid_lt, be32_sec_to_usec(a->iapdprefix.lifetime_valid, /* max_as_infinity= */ true)); + min_valid_lt = MIN(min_valid_lt, be32_sec_to_usec(a->iapdprefix.lifetime_valid, /* max_as_infinity = */ true)); } if (t2 == 0 || t2 > min_valid_lt) { @@ -272,9 +272,9 @@ int sd_dhcp6_lease_get_address_lifetime( a = &lease->addr_iter->iaaddr; if (ret_lifetime_preferred) - *ret_lifetime_preferred = be32_sec_to_usec(a->lifetime_preferred, /* max_as_infinity= */ true); + *ret_lifetime_preferred = be32_sec_to_usec(a->lifetime_preferred, /* max_as_infinity = */ true); if (ret_lifetime_valid) - *ret_lifetime_valid = be32_sec_to_usec(a->lifetime_valid, /* max_as_infinity= */ true); + *ret_lifetime_valid = be32_sec_to_usec(a->lifetime_valid, /* max_as_infinity = */ true); return 0; } @@ -334,9 +334,9 @@ int sd_dhcp6_lease_get_pd_lifetime( a = &lease->prefix_iter->iapdprefix; if (ret_lifetime_preferred) - *ret_lifetime_preferred = be32_sec_to_usec(a->lifetime_preferred, /* max_as_infinity= */ true); + *ret_lifetime_preferred = be32_sec_to_usec(a->lifetime_preferred, /* max_as_infinity = */ true); if (ret_lifetime_valid) - *ret_lifetime_valid = be32_sec_to_usec(a->lifetime_valid, /* max_as_infinity= */ true); + *ret_lifetime_valid = be32_sec_to_usec(a->lifetime_valid, /* max_as_infinity = */ true); return 0; } @@ -429,7 +429,7 @@ int dhcp6_lease_add_domains(sd_dhcp6_lease *lease, const uint8_t *optval, size_t if (r < 0) return r; - return strv_extend_strv_consume(&lease->domains, TAKE_PTR(domains), /* filter_duplicates= */ true); + return strv_extend_strv_consume(&lease->domains, TAKE_PTR(domains), /* filter_duplicates = */ true); } int sd_dhcp6_lease_get_domains(sd_dhcp6_lease *lease, char ***ret) { @@ -665,7 +665,7 @@ int dhcp6_lease_add_sip_domains(sd_dhcp6_lease *lease, const uint8_t *optval, si if (r < 0) return r; - return strv_extend_strv_consume(&lease->sip_domains, TAKE_PTR(domains), /* filter_duplicates= */ true); + return strv_extend_strv_consume(&lease->sip_domains, TAKE_PTR(domains), /* filter_duplicates = */ true); } int sd_dhcp6_lease_get_sip_domains(sd_dhcp6_lease *lease, char ***ret) { @@ -1011,7 +1011,7 @@ static int dhcp6_lease_parse_message( return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "Received information refresh time option with an invalid length (%zu).", optlen); - irt = unaligned_be32_sec_to_usec(optval, /* max_as_infinity= */ false); + irt = unaligned_be32_sec_to_usec(optval, /* max_as_infinity = */ false); break; case SD_DHCP6_OPTION_V6_DNR: diff --git a/src/libsystemd-network/sd-lldp-tx.c b/src/libsystemd-network/sd-lldp-tx.c index 4097091002a..f2f08e40ef8 100644 --- a/src/libsystemd-network/sd-lldp-tx.c +++ b/src/libsystemd-network/sd-lldp-tx.c @@ -365,7 +365,7 @@ static int lldp_tx_create_packet(sd_lldp_tx *lldp_tx, size_t *ret_packet_size, u assert(ret_packet); /* If ifname is not set yet, set ifname from ifindex. */ - r = sd_lldp_tx_get_ifname(lldp_tx, /* ret= */ NULL); + r = sd_lldp_tx_get_ifname(lldp_tx, /* ret = */ NULL); if (r < 0) return r; diff --git a/src/libsystemd-network/sd-ndisc-router.c b/src/libsystemd-network/sd-ndisc-router.c index 9d6181b3554..69fab9f6d0b 100644 --- a/src/libsystemd-network/sd-ndisc-router.c +++ b/src/libsystemd-network/sd-ndisc-router.c @@ -112,9 +112,9 @@ int ndisc_router_parse(sd_ndisc *nd, sd_ndisc_router *rt) { rt->hop_limit = a->nd_ra_curhoplimit; rt->flags = a->nd_ra_flags_reserved; /* the first 8 bits */ - rt->lifetime_usec = be16_sec_to_usec(a->nd_ra_router_lifetime, /* max_as_infinity= */ false); - rt->reachable_time_usec = be32_msec_to_usec(a->nd_ra_reachable, /* max_as_infinity= */ false); - rt->retransmission_time_usec = be32_msec_to_usec(a->nd_ra_retransmit, /* max_as_infinity= */ false); + rt->lifetime_usec = be16_sec_to_usec(a->nd_ra_router_lifetime, /* max_as_infinity = */ false); + rt->reachable_time_usec = be32_msec_to_usec(a->nd_ra_reachable, /* max_as_infinity = */ false); + rt->retransmission_time_usec = be32_msec_to_usec(a->nd_ra_retransmit, /* max_as_infinity = */ false); /* RFC 4191 section 2.2 * Prf (Default Router Preference) diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index 30c0de70047..0f2f94eab60 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -487,7 +487,7 @@ static int ndisc_setup_recv_event(sd_ndisc *nd) { assert(nd->ifindex > 0); _cleanup_close_ int fd = -EBADF; - fd = icmp6_bind(nd->ifindex, /* is_router= */ false); + fd = icmp6_bind(nd->ifindex, /* is_router = */ false); if (fd < 0) return fd; diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index b9c59d01643..02d6131e8a4 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -324,7 +324,7 @@ static int radv_setup_recv_event(sd_radv *ra) { assert(ra->ifindex > 0); _cleanup_close_ int fd = -EBADF; - fd = icmp6_bind(ra->ifindex, /* is_router= */ true); + fd = icmp6_bind(ra->ifindex, /* is_router = */ true); if (fd < 0) return fd; diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 35cfcec6aca..a14a97c1794 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -155,8 +155,8 @@ static void test_dhcp_identifier_set_iaid(void) { uint32_t iaid_legacy; be32_t iaid; - assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder= */ true, &iaid_legacy) >= 0); - assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder= */ false, &iaid) >= 0); + assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ true, &iaid_legacy) >= 0); + assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ false, &iaid) >= 0); /* we expect, that the MAC address was hashed. The legacy value is in native * endianness. */ @@ -176,7 +176,7 @@ static int check_options(uint8_t code, uint8_t len, const void *option, void *us uint32_t iaid; assert_se(sd_dhcp_duid_set_en(&duid) >= 0); - assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder= */ true, &iaid) >= 0); + assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ true, &iaid) >= 0); assert_se(len == sizeof(uint8_t) + sizeof(uint32_t) + duid.size); assert_se(len == 19); diff --git a/src/libsystemd-network/test-ndisc-send.c b/src/libsystemd-network/test-ndisc-send.c index 247cc0ec16c..7f94c7aeb0f 100644 --- a/src/libsystemd-network/test-ndisc-send.c +++ b/src/libsystemd-network/test-ndisc-send.c @@ -425,7 +425,7 @@ static int run(int argc, char *argv[]) { if (r <= 0) return r; - fd = icmp6_bind(arg_ifindex, /* is_router= */ false); + fd = icmp6_bind(arg_ifindex, /* is_router = */ false); if (fd < 0) return log_error_errno(fd, "Failed to bind socket to interface: %m"); diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c index 8d760660dcf..1e4899c3560 100644 --- a/src/libsystemd/sd-bus/bus-container.c +++ b/src/libsystemd/sd-bus/bus-container.c @@ -36,7 +36,7 @@ int bus_container_connect_socket(sd_bus *b) { log_debug("sd-bus: connecting bus%s%s to namespace of PID "PID_FMT"...", b->description ? " " : "", strempty(b->description), b->nspid); - r = namespace_open(b->nspid, &pidnsfd, &mntnsfd, /* ret_netns_fd= */ NULL, &usernsfd, &rootfd); + r = namespace_open(b->nspid, &pidnsfd, &mntnsfd, /* ret_netns_fd = */ NULL, &usernsfd, &rootfd); if (r < 0) return log_debug_errno(r, "Failed to open namespace of PID "PID_FMT": %m", b->nspid); diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c index 0812dc53247..12eb6f2cf38 100644 --- a/src/libsystemd/sd-bus/bus-creds.c +++ b/src/libsystemd/sd-bus/bus-creds.c @@ -949,7 +949,7 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, PidRef *pidref, pid_t tid unsigned long g; int n = 0; - p = skip_leading_chars(p, /* bad= */ NULL); + p = skip_leading_chars(p, /* bad = */ NULL); if (*p == 0) break; diff --git a/src/libsystemd/sd-bus/bus-dump-json.c b/src/libsystemd/sd-bus/bus-dump-json.c index 92fcde359b5..b6fc5f598f7 100644 --- a/src/libsystemd/sd-bus/bus-dump-json.c +++ b/src/libsystemd/sd-bus/bus-dump-json.c @@ -269,7 +269,7 @@ static int json_transform_one(sd_bus_message *m, sd_json_variant **ret) { default: return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "sd-bus: an invalid message type (signature=%s, type=%c, contents=%s).", - sd_bus_message_get_signature(m, /* complete= */ false), type, strna(contents)); + sd_bus_message_get_signature(m, /* complete = */ false), type, strna(contents)); } } diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index a77f45e634b..89ac7af341a 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -1361,7 +1361,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void p = strempty(p); - if (!signature_is_valid(p, /* allow_dict_entry= */ true)) + if (!signature_is_valid(p, /* allow_dict_entry = */ true)) return -EINVAL; align = 1; diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c index 30dcc3a81f8..48062ae37d6 100644 --- a/src/libsystemd/sd-bus/bus-objects.c +++ b/src/libsystemd/sd-bus/bus-objects.c @@ -526,7 +526,7 @@ static int invoke_property_set( return r; } - /* Automatic handling if no callback is defined. */ + /* Automatic handling if no callback is defined. */ assert(signature_is_single(v->x.property.signature, false)); assert(bus_type_is_basic(v->x.property.signature[0])); diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index 5f8d015569d..1ab014e8256 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -268,7 +268,7 @@ static int verify_anonymous_token(sd_bus *b, const char *p, size_t l) { if (l % 2 != 0) return 0; - r = unhexmem_full(p, l, /* secure= */ false, (void**) &token, &len); + r = unhexmem_full(p, l, /* secure = */ false, (void**) &token, &len); if (r < 0) return 0; @@ -300,7 +300,7 @@ static int verify_external_token(sd_bus *b, const char *p, size_t l) { if (l % 2 != 0) return 0; - r = unhexmem_full(p, l, /* secure= */ false, (void**) &token, &len); + r = unhexmem_full(p, l, /* secure = */ false, (void**) &token, &len); if (r < 0) return 0; @@ -668,7 +668,7 @@ static int bus_socket_read_auth(sd_bus *b) { b->rbuffer_size += k; if (handle_cmsg) { - r = bus_process_cmsg(b, &mh, /* allow_fds= */ false); + r = bus_process_cmsg(b, &mh, /* allow_fds = */ false); if (r < 0) return r; } diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index 8d7dd0823f7..4455f7d543e 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -783,7 +783,7 @@ _public_ int sd_pidfd_get_inode_id(int pidfd, uint64_t *ret) { /* Are pidfds backed by pidfs where the unique inode id is relevant? Note that the pidfd * passed to us is extrinsic and hence cannot be trusted to initialize our "have_pidfs" cache, * instead pidfd_check_pidfs() will allocate one internally. */ - r = pidfd_check_pidfs(/* pid_fd= */ -EBADF); + r = pidfd_check_pidfs(/* pid_fd = */ -EBADF); if (r <= 0) return -EOPNOTSUPP; diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index b3fe85a9761..dbb79cc3a95 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -172,7 +172,7 @@ _public_ int sd_device_enumerator_add_match_sysattr(sd_device_enumerator *enumer else hashmap = &enumerator->nomatch_sysattr; - r = update_match_strv(hashmap, sysattr, value, /* clear_on_null= */ true); + r = update_match_strv(hashmap, sysattr, value, /* clear_on_null = */ true); if (r <= 0) return r; @@ -187,7 +187,7 @@ _public_ int sd_device_enumerator_add_match_property(sd_device_enumerator *enume assert_return(enumerator, -EINVAL); assert_return(property, -EINVAL); - r = update_match_strv(&enumerator->match_property, property, value, /* clear_on_null= */ false); + r = update_match_strv(&enumerator->match_property, property, value, /* clear_on_null = */ false); if (r <= 0) return r; @@ -202,7 +202,7 @@ _public_ int sd_device_enumerator_add_match_property_required(sd_device_enumerat assert_return(enumerator, -EINVAL); assert_return(property, -EINVAL); - r = update_match_strv(&enumerator->match_property_required, property, value, /* clear_on_null= */ false); + r = update_match_strv(&enumerator->match_property_required, property, value, /* clear_on_null = */ false); if (r <= 0) return r; @@ -645,10 +645,10 @@ static int test_matches( if (r <= 0) return r; - if (!match_property(enumerator->match_property, device, /* match_all= */ false)) + if (!match_property(enumerator->match_property, device, /* match_all = */ false)) return false; - if (!match_property(enumerator->match_property_required, device, /* match_all= */ true)) + if (!match_property(enumerator->match_property_required, device, /* match_all = */ true)) return false; if (!device_match_sysattr(device, enumerator->match_sysattr, enumerator->nomatch_sysattr)) diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index 67d68bb07f9..e583e86fc56 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -309,7 +309,7 @@ _public_ int sd_device_monitor_stop(sd_device_monitor *m) { return r; /* Leave from all multicast groups to prevent the buffer is filled. */ - r = device_monitor_update_multicast_groups(m, /* add= */ false); + r = device_monitor_update_multicast_groups(m, /* add = */ false); if (r < 0) return r; @@ -376,7 +376,7 @@ _public_ int sd_device_monitor_start(sd_device_monitor *m, sd_device_monitor_han return r; /* Then, join the saved broadcast groups again. */ - r = device_monitor_update_multicast_groups(m, /* add= */ true); + r = device_monitor_update_multicast_groups(m, /* add = */ true); if (r < 0) return r; @@ -537,7 +537,7 @@ static bool check_sender_uid(sd_device_monitor *m, uid_t uid) { return true; if (!m->mapped_userns_uid_range) { - r = uid_range_load_userns(/* path= */ NULL, UID_RANGE_USERNS_INSIDE, &m->mapped_userns_uid_range); + r = uid_range_load_userns(/* path = */ NULL, UID_RANGE_USERNS_INSIDE, &m->mapped_userns_uid_range); if (r < 0) log_monitor_errno(m, r, "Failed to load UID ranges mapped to the current user namespace, ignoring: %m"); } @@ -942,7 +942,7 @@ _public_ int sd_device_monitor_filter_add_match_sysattr(sd_device_monitor *m, co hashmap = &m->nomatch_sysattr_filter; /* TODO: unset m->filter_uptodate on success when we support this filter on BPF. */ - return update_match_strv(hashmap, sysattr, value, /* clear_on_null= */ true); + return update_match_strv(hashmap, sysattr, value, /* clear_on_null = */ true); } _public_ int sd_device_monitor_filter_add_match_parent(sd_device_monitor *m, sd_device *device, int match) { diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index 035e7290e0e..2d5ea9cd501 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -685,7 +685,7 @@ int device_clone_with_db(sd_device *device, sd_device **ret) { } /* Finally, read the udev database. */ - r = device_read_db_internal(dest, /* force= */ true); + r = device_read_db_internal(dest, /* force = */ true); if (r < 0) return r; diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 526f183b1e9..dbee88c4520 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -274,7 +274,7 @@ static int device_new_from_syspath(sd_device **ret, const char *syspath, bool st } _public_ int sd_device_new_from_syspath(sd_device **ret, const char *syspath) { - return device_new_from_syspath(ret, syspath, /* strict= */ true); + return device_new_from_syspath(ret, syspath, /* strict = */ true); } int device_new_from_mode_and_devnum(sd_device **ret, mode_t mode, dev_t devnum) { @@ -486,13 +486,13 @@ _public_ int sd_device_new_from_subsystem_sysname( if (streq(subsystem, "subsystem")) { FOREACH_STRING(s, "/sys/bus/", "/sys/class/") { - r = device_new_from_path_join(&device, subsystem, /* driver_subsystem= */ NULL, sysname, s, name, NULL, NULL); + r = device_new_from_path_join(&device, subsystem, /* driver_subsystem = */ NULL, sysname, s, name, NULL, NULL); if (r < 0) return r; } } else if (streq(subsystem, "module")) { - r = device_new_from_path_join(&device, subsystem, /* driver_subsystem= */ NULL, sysname, "/sys/module/", name, NULL, NULL); + r = device_new_from_path_join(&device, subsystem, /* driver_subsystem = */ NULL, sysname, "/sys/module/", name, NULL, NULL); if (r < 0) return r; @@ -514,17 +514,17 @@ _public_ int sd_device_new_from_subsystem_sysname( } } - r = device_new_from_path_join(&device, subsystem, /* driver_subsystem= */ NULL, sysname, "/sys/bus/", subsystem, "/devices/", name); + r = device_new_from_path_join(&device, subsystem, /* driver_subsystem = */ NULL, sysname, "/sys/bus/", subsystem, "/devices/", name); if (r < 0) return r; - r = device_new_from_path_join(&device, subsystem, /* driver_subsystem= */ NULL, sysname, "/sys/class/", subsystem, name, NULL); + r = device_new_from_path_join(&device, subsystem, /* driver_subsystem = */ NULL, sysname, "/sys/class/", subsystem, name, NULL); if (r < 0) return r; /* Note that devices under /sys/firmware/ (e.g. /sys/firmware/devicetree/base/) do not have * subsystem. Hence, pass NULL for subsystem. See issue #35861. */ - r = device_new_from_path_join(&device, /* subsystem= */ NULL, /* driver_subsystem= */ NULL, sysname, "/sys/firmware/", subsystem, name, NULL); + r = device_new_from_path_join(&device, /* subsystem = */ NULL, /* driver_subsystem = */ NULL, sysname, "/sys/firmware/", subsystem, name, NULL); if (r < 0) return r; @@ -564,7 +564,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, /* chase_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) @@ -577,17 +577,17 @@ static int device_new_from_devname(sd_device **ret, const char *devname, bool st } _public_ int sd_device_new_from_devname(sd_device **ret, const char *devname) { - return device_new_from_devname(ret, devname, /* strict= */ true); + return device_new_from_devname(ret, devname, /* strict = */ true); } _public_ int sd_device_new_from_path(sd_device **ret, const char *path) { assert_return(ret, -EINVAL); assert_return(path, -EINVAL); - if (device_new_from_devname(ret, path, /* strict= */ false) >= 0) + if (device_new_from_devname(ret, path, /* strict = */ false) >= 0) return 0; - return device_new_from_syspath(ret, path, /* strict= */ false); + return device_new_from_syspath(ret, path, /* strict = */ false); } int device_set_devtype(sd_device *device, const char *devtype) { @@ -2445,7 +2445,7 @@ static int device_cache_sysattr_value_full(sd_device *device, char *key, char *v } int device_cache_sysattr_value(sd_device *device, char *key, char *value, int error) { - return device_cache_sysattr_value_full(device, key, value, strlen(value), error, /* ignore_uevent= */ true); + return device_cache_sysattr_value_full(device, key, value, strlen(value), error, /* ignore_uevent = */ true); } static int device_get_cached_sysattr_value(sd_device *device, const char *key, const char **ret_value, size_t *ret_size) { @@ -2495,7 +2495,7 @@ int device_chase(sd_device *device, const char *path, ChaseFlags flags, char **r _cleanup_free_ char *resolved = NULL; _cleanup_close_ int fd = -EBADF; - r = chase(path, /* root= */ NULL, CHASE_NO_AUTOFS | flags, &resolved, ret_fd ? &fd : NULL); + r = chase(path, /* root = */ NULL, CHASE_NO_AUTOFS | flags, &resolved, ret_fd ? &fd : NULL); if (r < 0) return r; @@ -2580,7 +2580,7 @@ _public_ int sd_device_get_sysattr_value_with_size(sd_device *device, const char return RET_GATHER(r, -ENOMEM); } - int k = device_cache_sysattr_value_full(device, resolved, value, size, -r, /* ignore_uevent= */ false); + int k = device_cache_sysattr_value_full(device, resolved, value, size, -r, /* ignore_uevent = */ false); if (k < 0) { if (r < 0) log_device_debug_errno(device, k, @@ -2711,7 +2711,7 @@ static int device_remove_cached_sysattr_value(sd_device *device, const char *sys assert(sysattr); _cleanup_free_ char *resolved = NULL; - r = device_chase(device, sysattr, CHASE_PREFIX_ROOT | CHASE_NONEXISTENT, &resolved, /* ret_fd= */ NULL); + r = device_chase(device, sysattr, CHASE_PREFIX_ROOT | CHASE_NONEXISTENT, &resolved, /* ret_fd = */ NULL); if (r < 0) return r; diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index 638598125a8..02525c83ec5 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -55,7 +55,7 @@ TEST(mdio_bus) { { sd_device_get_sysname, "Qualcomm Atheros AR8031/AR8033" }, }; - ASSERT_OK_ERRNO(setenv("SYSTEMD_DEVICE_VERIFY_SYSFS", "0", /* overwrite= */ false)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_DEVICE_VERIFY_SYSFS", "0", /* overwrite = */ false)); ASSERT_OK(mount_nofollow_verbose(LOG_ERR, "tmpfs", "/sys/bus/", "tmpfs", 0, NULL)); r = mkdir_p(syspath, 0755); if (ERRNO_IS_NEG_PRIVILEGE(r)) { diff --git a/src/libsystemd/sd-event/event-util.c b/src/libsystemd/sd-event/event-util.c index c004f2976aa..7e8c481bcf4 100644 --- a/src/libsystemd/sd-event/event-util.c +++ b/src/libsystemd/sd-event/event-util.c @@ -272,7 +272,7 @@ static int event_forward_signal_callback(sd_event_source *s, const struct signal si.si_int = ssi->ssi_int; si.si_ptr = UINT64_TO_PTR(ssi->ssi_ptr); - return sd_event_source_send_child_signal(child, ssi->ssi_signo, &si, /* flags= */ 0); + return sd_event_source_send_child_signal(child, ssi->ssi_signo, &si, /* flags = */ 0); } static void event_forward_signal_destroy(void *userdata) { diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 5a9c54d8e1d..a2a70c99406 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -3620,7 +3620,7 @@ static int process_timer( * again. */ assert(s->ratelimited); - r = event_source_leave_ratelimit(s, /* run_callback= */ true); + r = event_source_leave_ratelimit(s, /* run_callback = */ true); if (r < 0) return r; else if (r == 1) @@ -5151,7 +5151,7 @@ _public_ int sd_event_source_set_ratelimit(sd_event_source *s, uint64_t interval /* When ratelimiting is configured we'll always reset the rate limit state first and start fresh, * non-ratelimited. */ - r = event_source_leave_ratelimit(s, /* run_callback= */ false); + r = event_source_leave_ratelimit(s, /* run_callback = */ false); if (r < 0) return r; @@ -5214,7 +5214,7 @@ _public_ int sd_event_source_leave_ratelimit(sd_event_source *s) { if (!s->ratelimited) return 0; - r = event_source_leave_ratelimit(s, /* run_callback= */ false); + r = event_source_leave_ratelimit(s, /* run_callback = */ false); if (r < 0) return r; diff --git a/src/libsystemd/sd-id128/id128-util.c b/src/libsystemd/sd-id128/id128-util.c index 0aaa98292d7..f5dcf2ecf25 100644 --- a/src/libsystemd/sd-id128/id128-util.c +++ b/src/libsystemd/sd-id128/id128-util.c @@ -188,7 +188,7 @@ int id128_write_at(int dir_fd, const char *path, Id128Flag f, sd_id128_t id) { assert(dir_fd >= 0 || dir_fd == AT_FDCWD); assert(path); - fd = xopenat_full(dir_fd, path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, /* xopen_flags= */ 0, 0444); + fd = xopenat_full(dir_fd, path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, /* xopen_flags = */ 0, 0444); if (fd < 0) return fd; @@ -289,7 +289,7 @@ int id128_get_boot_for_machine(const char *machine, sd_id128_t *ret) { if (r < 0) return r; - r = namespace_open(pid, &pidnsfd, &mntnsfd, /* ret_netns_fd= */ NULL, /* ret_userns_fd= */ NULL, &rootfd); + r = namespace_open(pid, &pidnsfd, &mntnsfd, /* ret_netns_fd = */ NULL, /* ret_userns_fd = */ NULL, &rootfd); if (r < 0) return r; diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index b3fa41ffbf7..7792d8433f1 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -1827,7 +1827,7 @@ static int maybe_compress_payload( return 0; } - r = compress_blob(c, src, size, dst, size - 1, rsize, /* level= */ -1); + r = compress_blob(c, src, size, dst, size - 1, rsize, /* level = */ -1); if (r < 0) return log_debug_errno(r, "Failed to compress data object using %s, ignoring: %m", compression_to_string(c)); diff --git a/src/libsystemd/sd-journal/journal-verify.c b/src/libsystemd/sd-journal/journal-verify.c index 0afb664896a..db566288b72 100644 --- a/src/libsystemd/sd-journal/journal-verify.c +++ b/src/libsystemd/sd-journal/journal-verify.c @@ -756,7 +756,7 @@ static int verify_entry_array( if (r < 0) return r; - r = verify_entry(f, o, p, cache_data_fd, n_data, /* last= */ i + 1 == n); + r = verify_entry(f, o, p, cache_data_fd, n_data, /*last=*/ i + 1 == n); if (r < 0) return r; diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 20cf100ec8b..a02c358fad8 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -1749,7 +1749,7 @@ static int add_file_by_name( if (!path) return -ENOMEM; - return add_any_file(j, /* fd= */ -EBADF, path); + return add_any_file(j, /* fd = */ -EBADF, path); } static int remove_file_by_name( @@ -2105,7 +2105,7 @@ static int add_directory( goto fail; } - r = add_directory_impl(j, path, /* is_root= */ false, &m); + r = add_directory_impl(j, path, /* is_root = */ false, &m); if (r < 0) goto fail; if (r == 0) @@ -2187,7 +2187,7 @@ static int add_root_directory(sd_journal *j, const char *p, bool missing_ok) { rewinddir(d); } - r = add_directory_impl(j, p, /* is_root= */ true, &m); + r = add_directory_impl(j, p, /* is_root = */ true, &m); if (r < 0) goto fail; if (r == 0) @@ -2436,7 +2436,7 @@ _public_ int sd_journal_open_files(sd_journal **ret, const char **paths, int fla return -ENOMEM; STRV_FOREACH(path, paths) { - r = add_any_file(j, /* fd= */ -EBADF, *path); + r = add_any_file(j, /* fd = */ -EBADF, *path); if (r < 0) return r; } @@ -2523,7 +2523,7 @@ _public_ int sd_journal_open_files_fd(sd_journal **ret, int fds[], unsigned n_fd if (r < 0) goto fail; - r = add_any_file(j, fds[i], /* path= */ NULL); + r = add_any_file(j, fds[i], /* path = */ NULL); if (r < 0) goto fail; } diff --git a/src/libsystemd/sd-journal/test-journal-flush.c b/src/libsystemd/sd-journal/test-journal-flush.c index 0301dd8f69d..ef5acca9c0c 100644 --- a/src/libsystemd/sd-journal/test-journal-flush.c +++ b/src/libsystemd/sd-journal/test-journal-flush.c @@ -179,7 +179,7 @@ static void test_journal_flush_one(int argc, char *argv[]) { /* Archive and offline file. */ assert_se(journal_file_archive(new_journal, NULL) >= 0); - assert_se(journal_file_set_offline(new_journal, /* wait= */ true) >= 0); + assert_se(journal_file_set_offline(new_journal, /* wait = */ true) >= 0); /* Read the archived and offline journal. */ for (uint64_t q = ALIGN64(p + 1); q < (uint64_t) j->current_file->last_stat.st_size; q = ALIGN64(q + 1)) { diff --git a/src/libsystemd/sd-journal/test-journal-interleaving.c b/src/libsystemd/sd-journal/test-journal-interleaving.c index fbbaa82850d..d5d6506a44c 100644 --- a/src/libsystemd/sd-journal/test-journal-interleaving.c +++ b/src/libsystemd/sd-journal/test-journal-interleaving.c @@ -446,7 +446,7 @@ static void test_boot_id_one(void (*setup)(void), size_t n_ids_expected) { ASSERT_OK(sd_journal_open_directory(&j, t, SD_JOURNAL_ASSUME_IMMUTABLE)); ASSERT_OK(journal_get_boots( j, - /* advance_older= */ false, /* max_ids= */ SIZE_MAX, + /* advance_older = */ false, /* max_ids = */ SIZE_MAX, &ids, &n_ids)); ASSERT_NOT_NULL(ids); ASSERT_EQ(n_ids, n_ids_expected); @@ -477,7 +477,7 @@ static void test_boot_id_one(void (*setup)(void), size_t n_ids_expected) { ASSERT_OK(journal_get_boots( j, - /* advance_older= */ false, /* max_ids= */ i, + /* advance_older = */ false, /* max_ids = */ i, &ids_limited, &n_ids_limited)); ASSERT_TRUE(ids_limited || i == 0); ASSERT_EQ(n_ids_limited, MIN(i, n_ids_expected)); @@ -490,7 +490,7 @@ static void test_boot_id_one(void (*setup)(void), size_t n_ids_expected) { ASSERT_OK(journal_get_boots( j, - /* advance_older= */ true, /* max_ids= */ i, + /* advance_older = */ true, /* max_ids = */ i, &ids_limited, &n_ids_limited)); ASSERT_TRUE(ids_limited || i == 0); ASSERT_EQ(n_ids_limited, MIN(i, n_ids_expected)); @@ -1136,15 +1136,15 @@ static void append_test_entry_full( iovec, n_iovec, seqnum, seqnum_id, - /* ret_object= */ NULL, - /* ret_offset= */ NULL), EREMCHG); + /* ret_object = */ NULL, + /* ret_offset = */ NULL), EREMCHG); ASSERT_OK(journal_file_rotate( f, m, - /* file_flags= */ JOURNAL_STRICT_ORDER, - /* compress_threshold_bytes= */ UINT64_MAX, - /* deferred_closes= */ NULL)); + /* file_flags = */ JOURNAL_STRICT_ORDER, + /* compress_threshold_bytes = */ UINT64_MAX, + /* deferred_closes = */ NULL)); } ASSERT_OK(journal_file_append_entry( @@ -1154,8 +1154,8 @@ static void append_test_entry_full( iovec, n_iovec, seqnum, seqnum_id, - /* ret_object= */ NULL, - /* ret_offset= */ NULL)); + /* ret_object = */ NULL, + /* ret_offset = */ NULL)); ASSERT_NOT_NULL(GREEDY_REALLOC(*entries, *n_entries + 1)); (*entries)[(*n_entries)++] = (TestEntry) { @@ -1179,7 +1179,7 @@ static void append_test_entry( unsigned *number, unsigned data) { - append_test_entry_full(&f, NULL, entries, n_entries, seqnum, seqnum_id, boot_id, ts, number, data, /* expect_rotate= */ false); + append_test_entry_full(&f, NULL, entries, n_entries, seqnum, seqnum_id, boot_id, ts, number, data, /* expect_rotate = */ false); } TEST(seek_time) { @@ -1199,10 +1199,10 @@ TEST(seek_time) { O_RDWR|O_CREAT, JOURNAL_STRICT_ORDER, 0644, - /* compress_threshold_bytes= */ UINT64_MAX, - /* metrics= */ NULL, + /* compress_threshold_bytes = */ UINT64_MAX, + /* metrics = */ NULL, m, - /* template= */ NULL, + /* template = */ NULL, &f)); uint64_t seqnum = 1; @@ -1229,7 +1229,7 @@ TEST(seek_time) { /* realtime goes to backward */ ts.realtime -= 100; ts.monotonic += 10; - append_test_entry_full(&f, m, &entries, &n_entries, &seqnum, &seqnum_id, &boot_id, &ts, &n, 200, /* expect_rotate= */ true); + append_test_entry_full(&f, m, &entries, &n_entries, &seqnum, &seqnum_id, &boot_id, &ts, &n, 200, /* expect_rotate = */ true); ts.realtime += 10; ts.monotonic += 10; @@ -1305,19 +1305,19 @@ TEST(seek_time) { } FOREACH_ARRAY(e, entries, n_entries) { - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ true, e->boot_id, e->ts.monotonic - 1, data); - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ true, e->boot_id, e->ts.monotonic, data); - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ true, e->boot_id, e->ts.monotonic + 1, data); - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ false, e->boot_id, e->ts.monotonic - 1, data); - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ false, e->boot_id, e->ts.monotonic, data); - test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next= */ false, e->boot_id, e->ts.monotonic + 1, data); - - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ true, e->ts.monotonic - 1, data); - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ true, e->ts.monotonic, data); - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ true, e->ts.monotonic + 1, data); - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ false, e->ts.monotonic - 1, data); - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ false, e->ts.monotonic, data); - test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next= */ false, e->ts.monotonic + 1, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ true, e->boot_id, e->ts.monotonic - 1, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ true, e->boot_id, e->ts.monotonic, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ true, e->boot_id, e->ts.monotonic + 1, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ false, e->boot_id, e->ts.monotonic - 1, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ false, e->boot_id, e->ts.monotonic, data); + test_sd_journal_seek_monotonic_usec(j, entries, n_entries, /* next = */ false, e->boot_id, e->ts.monotonic + 1, data); + + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ true, e->ts.monotonic - 1, data); + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ true, e->ts.monotonic, data); + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ true, e->ts.monotonic + 1, data); + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ false, e->ts.monotonic - 1, data); + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ false, e->ts.monotonic, data); + test_sd_journal_seek_realtime_usec(j, entries, n_entries, /* next = */ false, e->ts.monotonic + 1, data); } } } diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index 8045c88d60a..89d045fae9f 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -799,9 +799,9 @@ int sd_netlink_message_read(sd_netlink_message *m, uint16_t attr_type, size_t si assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ false, + m, attr_type, /* strict = */ false, _NETLINK_TYPE_INVALID, size, - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int sd_netlink_message_read_data(sd_netlink_message *m, uint16_t attr_type, size_t *ret_size, void **ret_data) { @@ -870,9 +870,9 @@ int sd_netlink_message_read_u8(sd_netlink_message *m, uint16_t attr_type, uint8_ assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_U8, sizeof(uint8_t), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int sd_netlink_message_read_u16(sd_netlink_message *m, uint16_t attr_type, uint16_t *ret) { @@ -883,7 +883,7 @@ int sd_netlink_message_read_u16(sd_netlink_message *m, uint16_t attr_type, uint1 assert_return(m, -EINVAL); r = netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_U16, sizeof(uint16_t), ret ? &u : NULL, &net_byteorder); if (r < 0) @@ -903,7 +903,7 @@ int sd_netlink_message_read_u32(sd_netlink_message *m, uint16_t attr_type, uint3 assert_return(m, -EINVAL); r = netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_U32, sizeof(uint32_t), ret ? &u : NULL, &net_byteorder); if (r < 0) @@ -923,7 +923,7 @@ int sd_netlink_message_read_u64(sd_netlink_message *m, uint16_t attr_type, uint6 assert_return(m, -EINVAL); r = netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_U64, sizeof(uint64_t), ret ? &u : NULL, &net_byteorder); if (r < 0) @@ -939,9 +939,9 @@ int sd_netlink_message_read_ether_addr(sd_netlink_message *m, uint16_t attr_type assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_ETHER_ADDR, sizeof(struct ether_addr), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int netlink_message_read_hw_addr(sd_netlink_message *m, uint16_t attr_type, struct hw_addr_data *ret) { @@ -950,9 +950,9 @@ int netlink_message_read_hw_addr(sd_netlink_message *m, uint16_t attr_type, stru assert_return(m, -EINVAL); r = netlink_message_read_impl( - m, attr_type, /* strict= */ false, + m, attr_type, /* strict = */ false, NETLINK_TYPE_ETHER_ADDR, HW_ADDR_MAX_SIZE, - ret ? ret->bytes : NULL, /* ret_net_byteorder= */ NULL); + ret ? ret->bytes : NULL, /* ret_net_byteorder = */ NULL); if (r < 0) return r; @@ -966,9 +966,9 @@ int sd_netlink_message_read_cache_info(sd_netlink_message *m, uint16_t attr_type assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_CACHE_INFO, sizeof(struct ifa_cacheinfo), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int netlink_message_read_in_addr_union(sd_netlink_message *m, uint16_t attr_type, int family, union in_addr_union *ret) { @@ -978,9 +978,9 @@ int netlink_message_read_in_addr_union(sd_netlink_message *m, uint16_t attr_type assert_return(IN_SET(family, AF_INET, AF_INET6), -EINVAL); r = netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_IN_ADDR, FAMILY_ADDRESS_SIZE(family), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); if (r < 0) return r; @@ -994,18 +994,18 @@ int sd_netlink_message_read_in_addr(sd_netlink_message *m, uint16_t attr_type, s assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_IN_ADDR, sizeof(struct in_addr), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int sd_netlink_message_read_in6_addr(sd_netlink_message *m, uint16_t attr_type, struct in6_addr *ret) { assert_return(m, -EINVAL); return netlink_message_read_impl( - m, attr_type, /* strict= */ true, + m, attr_type, /* strict = */ true, NETLINK_TYPE_IN_ADDR, sizeof(struct in6_addr), - ret, /* ret_net_byteorder= */ NULL); + ret, /* ret_net_byteorder = */ NULL); } int sd_netlink_message_has_flag(sd_netlink_message *m, uint16_t attr_type) { diff --git a/src/libsystemd/sd-netlink/netlink-util.h b/src/libsystemd/sd-netlink/netlink-util.h index 25ef069e3f7..02b17f50cf8 100644 --- a/src/libsystemd/sd-netlink/netlink-util.h +++ b/src/libsystemd/sd-netlink/netlink-util.h @@ -32,11 +32,11 @@ static inline int rtnl_get_ifname_full(sd_netlink **rtnl, int ifindex, char **re ifindex, ret_name, ret_altnames, - /* ret_iftype= */ NULL, - /* ret_flags= */ NULL, - /* ret_kind= */ NULL, - /* ret_hw_addr= */ NULL, - /* ret_permanent_hw_addr= */ NULL); + /* ret_iftype = */ NULL, + /* ret_flags = */ NULL, + /* ret_kind = */ NULL, + /* ret_hw_addr = */ NULL, + /* ret_permanent_hw_addr = */ NULL); } static inline int rtnl_get_ifname(sd_netlink **rtnl, int ifindex, char **ret) { return rtnl_get_ifname_full(rtnl, ifindex, ret, NULL); @@ -56,8 +56,8 @@ static inline int rtnl_get_link_info( return rtnl_get_link_info_full( rtnl, ifindex, - /* ret_name= */ NULL, - /* ret_altnames= */ NULL, + /* ret_name = */ NULL, + /* ret_altnames = */ NULL, ret_iftype, ret_flags, ret_kind, @@ -68,11 +68,11 @@ static inline int rtnl_get_link_hw_addr(sd_netlink **rtnl, int ifindex, struct h return rtnl_get_link_info( rtnl, ifindex, - /* ret_iftype= */ NULL, - /* ret_flags= */ NULL, - /* ret_kind= */ NULL, + /* ret_iftype = */ NULL, + /* ret_flags = */ NULL, + /* ret_kind = */ NULL, ret, - /* ret_permanent_hw_addr= */ NULL); + /* ret_permanent_hw_addr = */ NULL); } typedef enum ResolveInterfaceNameFlag { diff --git a/src/libsystemd/sd-path/path-lookup.c b/src/libsystemd/sd-path/path-lookup.c index 389d7e2ad95..3ae217a7c5e 100644 --- a/src/libsystemd/sd-path/path-lookup.c +++ b/src/libsystemd/sd-path/path-lookup.c @@ -363,14 +363,14 @@ static char** user_unit_search_dirs( if (!paths) return NULL; - if (strv_extend_strv_consume(&paths, TAKE_PTR(config_dirs), /* filter_duplicates= */ false) < 0) + if (strv_extend_strv_consume(&paths, TAKE_PTR(config_dirs), /* filter_duplicates = */ false) < 0) return NULL; /* global config has lower priority than the user config of the same type */ if (strv_extend(&paths, global_persistent_config) < 0) return NULL; - if (strv_extend_strv(&paths, (char* const*) user_config_unit_paths, /* filter_duplicates= */ false) < 0) + if (strv_extend_strv(&paths, (char* const*) user_config_unit_paths, /* filter_duplicates = */ false) < 0) return NULL; /* strv_extend_many() can deal with NULL-s in arguments */ @@ -380,7 +380,7 @@ static char** user_unit_search_dirs( generator) < 0) return NULL; - if (strv_extend_strv_consume(&paths, TAKE_PTR(data_dirs), /* filter_duplicates= */ false) < 0) + if (strv_extend_strv_consume(&paths, TAKE_PTR(data_dirs), /* filter_duplicates = */ false) < 0) return NULL; if (strv_extend_strv(&paths, (char* const*) user_data_unit_paths, false) < 0) @@ -550,7 +550,7 @@ int lookup_paths_init( return -ENOMEM; /* strv_uniq() below would filter all duplicates against the final strv */ - r = strv_extend_strv_consume(&paths, TAKE_PTR(add), /* filter_duplicates= */ false); + r = strv_extend_strv_consume(&paths, TAKE_PTR(add), /* filter_duplicates = */ false); if (r < 0) return r; } @@ -731,7 +731,7 @@ char** generator_binary_paths_internal(RuntimeScope scope, bool env_generator) { return NULL; if (!paths || r > 0) { - r = strv_extend_strv(&paths, (char* const*) generator_paths, /* filter_duplicates= */ true); + r = strv_extend_strv(&paths, (char* const*) generator_paths, /* filter_duplicates = */ true); if (r < 0) return NULL; } diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c index e009a71bea0..b80b8ca68d2 100644 --- a/src/libsystemd/sd-path/sd-path.c +++ b/src/libsystemd/sd-path/sd-path.c @@ -130,7 +130,7 @@ static int from_xdg_user_dir(const char *field, char **buffer, const char **ret) const char *s = startswith(p, "$HOME/"); if (s) - return from_home_dir(/* envname= */ NULL, s, buffer, ret); + return from_home_dir(/* envname = */ NULL, s, buffer, ret); if (path_is_absolute(p)) { char *c = strdup(p); @@ -145,7 +145,7 @@ static int from_xdg_user_dir(const char *field, char **buffer, const char **ret) fallback: /* The desktop directory defaults to $HOME/Desktop, the others to $HOME */ if (streq(field, "XDG_DESKTOP_DIR")) - return from_home_dir(/* envname= */ NULL, "Desktop", buffer, ret); + return from_home_dir(/* envname = */ NULL, "Desktop", buffer, ret); home: r = get_home_dir(buffer); diff --git a/src/libsystemd/sd-varlink/sd-varlink.c b/src/libsystemd/sd-varlink/sd-varlink.c index b7b5052a930..563e72dbaed 100644 --- a/src/libsystemd/sd-varlink/sd-varlink.c +++ b/src/libsystemd/sd-varlink/sd-varlink.c @@ -1216,7 +1216,7 @@ static int generic_method_get_info( assert(link); assert(link->server); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c index 0385c4679e9..4c4de297b95 100644 --- a/src/libudev/libudev-list.c +++ b/src/libudev/libudev-list.c @@ -143,7 +143,7 @@ struct udev_list_entry* udev_list_get_entry(struct udev_list *list) { else { _cleanup_free_ struct udev_list_entry **buf = NULL; - if (hashmap_dump_sorted(list->unique_entries, (void***) &buf, /* ret_n= */ NULL) < 0) + if (hashmap_dump_sorted(list->unique_entries, (void***) &buf, /* ret_n = */ NULL) < 0) return NULL; for (size_t j = n; j > 0; j--) diff --git a/src/locale/test-localed-util.c b/src/locale/test-localed-util.c index 8e41406298a..92fe7b0421e 100644 --- a/src/locale/test-localed-util.c +++ b/src/locale/test-localed-util.c @@ -225,7 +225,7 @@ static int intro(void) { _cleanup_free_ char *map = NULL; ASSERT_OK(get_testdata_dir("test-keymap-util/kbd-model-map", &map)); - ASSERT_OK_ERRNO(setenv("SYSTEMD_KBD_MODEL_MAP", map, /* overwrite= */ true)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_KBD_MODEL_MAP", map, /* overwrite = */ true)); return EXIT_SUCCESS; } diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 1ff650c2adb..adb666aef93 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -163,7 +163,7 @@ static int list_sessions_table_add(Table *table, sd_bus_message *reply) { &tty, &idle, &idle_timestamp_monotonic, - /* object= */ NULL); + /* object = */ NULL); if (r < 0) return bus_log_parse_error(r); if (r == 0) @@ -721,21 +721,21 @@ static int print_session_status_info(sd_bus *bus, const char *path) { return table_log_print_error(r); if (i.scope) { - show_unit_cgroup(bus, i.scope, i.leader, /* prefix= */ strrepa(" ", STRLEN("Display: "))); + show_unit_cgroup(bus, i.scope, i.leader, /* prefix = */ strrepa(" ", STRLEN("Display: "))); if (arg_transport == BUS_TRANSPORT_LOCAL) show_journal_by_unit( stdout, i.scope, - /* namespace= */ NULL, + /* namespace = */ NULL, arg_output, - /* n_columns= */ 0, + /* n_columns = */ 0, i.timestamp.monotonic, arg_lines, get_output_flags() | OUTPUT_BEGIN_NEWLINE, SD_JOURNAL_LOCAL_ONLY, - /* system_unit= */ true, - /* ellipsized= */ NULL); + /* system_unit = */ true, + /* ellipsized = */ NULL); } return 0; @@ -826,21 +826,21 @@ static int print_user_status_info(sd_bus *bus, const char *path) { return table_log_print_error(r); if (i.slice) { - show_unit_cgroup(bus, i.slice, /* leader= */ 0, /* prefix= */ strrepa(" ", STRLEN("Sessions: "))); + show_unit_cgroup(bus, i.slice, /* leader = */ 0, /* prefix = */ strrepa(" ", STRLEN("Sessions: "))); if (arg_transport == BUS_TRANSPORT_LOCAL) show_journal_by_unit( stdout, i.slice, - /* namespace= */ NULL, + /* namespace = */ NULL, arg_output, - /* n_columns= */ 0, + /* n_columns = */ 0, i.timestamp.monotonic, arg_lines, get_output_flags() | OUTPUT_BEGIN_NEWLINE, SD_JOURNAL_LOCAL_ONLY, - /* system_unit= */ true, - /* ellipsized= */ NULL); + /* system_unit = */ true, + /* ellipsized = */ NULL); } return 0; diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index ab113afbab0..1e729761acb 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1304,7 +1304,7 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus error, uid, leader_pid, - /* leader_pidfd= */ -EBADF, + /* leader_pidfd = */ -EBADF, service, type, class, @@ -1316,7 +1316,7 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus remote, remote_user, remote_host, - /* flags= */ 0); + /* flags = */ 0); } static int method_create_session_pidfd(sd_bus_message *message, void *userdata, sd_bus_error *error) { @@ -1351,7 +1351,7 @@ static int method_create_session_pidfd(sd_bus_message *message, void *userdata, message, error, uid, - /* leader_pid= */ 0, + /* leader_pid = */ 0, leader_fd, service, type, @@ -2115,9 +2115,9 @@ static int delay_shutdown_or_sleep( r = event_reset_time_relative( m->event, &m->inhibit_timeout_source, - CLOCK_MONOTONIC, m->inhibit_delay_max, /* accuracy= */ 0, + CLOCK_MONOTONIC, m->inhibit_delay_max, /* accuracy = */ 0, manager_inhibit_timeout_handler, m, - /* priority= */ 0, "inhibit-timeout", /* force_reset= */ true); + /* priority = */ 0, "inhibit-timeout", /* force_reset = */ true); if (r < 0) return log_error_errno(r, "Failed to reset timer event source for inhibit timeout: %m"); @@ -2538,7 +2538,7 @@ static int method_sleep(sd_bus_message *message, void *userdata, sd_bus_error *e return method_do_shutdown_or_sleep( m, message, HANDLE_SLEEP, - /* with_flags= */ true, + /* with_flags = */ true, error); } @@ -4433,7 +4433,7 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err LIST_FOREACH(sessions_by_user, s, user->sessions) /* Don't propagate user service failures to the client */ - session_jobs_reply(s, id, unit, /* result= */ NULL); + session_jobs_reply(s, id, unit, /* result = */ NULL); user_save(user); break; @@ -4666,7 +4666,7 @@ int manager_start_scope( manager, scope, pidref, - /* allow_pidfd= */ false, + /* allow_pidfd = */ false, slice, description, requires, diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c index a07a0e49ee5..e1f00e880c9 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -146,7 +146,7 @@ int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_er if (r == 0) return 1; /* Will call us back */ - r = seat_stop_sessions(s, /* force= */ true); + r = seat_stop_sessions(s, /* force = */ true); if (r < 0) return r; diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index cc71efb60ed..3a3148be14f 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -389,7 +389,7 @@ static int static_node_acl(Seat *s) { RET_GATHER(ret, log_debug_errno(r, "Failed to apply ACL on '%s': %m", node ?: de->d_name)); /* Better be safe than sorry and reset ACL */ - r = devnode_acl(fd, /* uid= */ 0); + r = devnode_acl(fd, /* uid = */ 0); if (r >= 0 || r == -ENOENT) continue; } diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index e6513949b19..1614fb47193 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -216,7 +216,7 @@ int bus_session_method_terminate(sd_bus_message *message, void *userdata, sd_bus if (r == 0) return 1; /* Will call us back */ - r = session_stop(s, /* force= */ true); + r = session_stop(s, /* force = */ true); if (r < 0) return r; diff --git a/src/login/logind-session.c b/src/login/logind-session.c index b30252cd09c..d0c36f1b41e 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -195,7 +195,7 @@ Session* session_free(Session *s) { free(s->scope_job); - session_reset_leader(s, /* keep_fdstore= */ true); + session_reset_leader(s, /* keep_fdstore = */ true); sd_bus_message_unref(s->create_message); sd_bus_message_unref(s->upgrade_message); @@ -239,7 +239,7 @@ int session_set_leader_consume(Session *s, PidRef _leader) { if (pidref_equal(&s->leader, &pidref)) return 0; - session_reset_leader(s, /* keep_fdstore= */ false); + session_reset_leader(s, /* keep_fdstore = */ false); s->leader = TAKE_PIDREF(pidref); @@ -401,7 +401,7 @@ static int session_load_devices(Session *s, const char *devices) { } /* The file descriptors for loaded devices will be reattached later. */ - RET_GATHER(r, session_device_new(s, dev, /* open_device= */ false, /* ret= */ NULL)); + RET_GATHER(r, session_device_new(s, dev, /* open_device = */ false, /* ret = */ NULL)); } if (r < 0) @@ -728,18 +728,18 @@ static int session_start_scope(Session *s, sd_bus_message *properties, sd_bus_er s->manager, scope, &s->leader, - /* allow_pidfd= */ true, + /* allow_pidfd = */ true, s->user->slice, description, /* These should have been pulled in explicitly in user_start(). Just to be sure. */ - /* requires= */ STRV_MAKE_CONST(s->user->runtime_dir_unit), - /* wants= */ STRV_MAKE_CONST(SESSION_CLASS_WANTS_SERVICE_MANAGER(s->class) ? s->user->service_manager_unit : NULL), + /* requires = */ STRV_MAKE_CONST(s->user->runtime_dir_unit), + /* wants = */ STRV_MAKE_CONST(SESSION_CLASS_WANTS_SERVICE_MANAGER(s->class) ? s->user->service_manager_unit : NULL), /* We usually want to order session scopes after systemd-user-sessions.service * since the unit is used as login session barrier for unprivileged users. However * the barrier doesn't apply for root as sysadmin should always be able to log in * (and without waiting for any timeout to expire) in case something goes wrong * during the boot process. */ - /* extra_after= */ STRV_MAKE_CONST("systemd-logind.service", + /* extra_after = */ STRV_MAKE_CONST("systemd-logind.service", SESSION_CLASS_IS_EARLY(s->class) ? NULL : "systemd-user-sessions.service"), user_record_home_directory(s->user->user_record), properties, @@ -770,7 +770,7 @@ static int session_dispatch_stop_on_idle(sd_event_source *source, uint64_t t, vo if (idle) { log_info("Session \"%s\" of user \"%s\" is idle, stopping.", s->id, s->user->user_record->user_name); - return session_stop(s, /* force= */ true); + return session_stop(s, /* force = */ true); } r = sd_event_source_set_time( @@ -997,7 +997,7 @@ int session_finalize(Session *s) { seat_save(s->seat); } - session_reset_leader(s, /* keep_fdstore= */ false); + session_reset_leader(s, /* keep_fdstore = */ false); (void) user_save(s->user); (void) user_send_changed(s->user, "Display"); @@ -1010,7 +1010,7 @@ static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *us assert(es); - session_stop(s, /* force= */ false); + session_stop(s, /* force = */ false); return 0; } @@ -1360,7 +1360,7 @@ static int session_prepare_vt(Session *s) { if (s->vtnr < 1) return 0; - vt = session_open_vt(s, /* reopen= */ false); + vt = session_open_vt(s, /* reopen = */ false); if (vt < 0) return vt; @@ -1426,7 +1426,7 @@ static void session_restore_vt(Session *s) { /* We do a little dance to avoid having the terminal be available * for reuse before we've cleaned it up. */ - int fd = session_open_vt(s, /* reopen= */ true); + int fd = session_open_vt(s, /* reopen = */ true); if (fd >= 0) r = vt_restore(fd); } @@ -1456,13 +1456,13 @@ void session_leave_vt(Session *s) { return; session_device_pause_all(s); - r = vt_release(s->vtfd, /* restore= */ false); + r = vt_release(s->vtfd, /* restore = */ false); if (r == -EIO) { /* Handle the same VT hung-up case as in session_restore_vt */ - int fd = session_open_vt(s, /* reopen= */ true); + int fd = session_open_vt(s, /* reopen = */ true); if (fd >= 0) - r = vt_release(fd, /* restore= */ false); + r = vt_release(fd, /* restore = */ false); } if (r < 0) log_debug_errno(r, "Cannot release VT of session %s: %m", s->id); diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c index b67e21e0523..b23891767ee 100644 --- a/src/login/logind-user-dbus.c +++ b/src/login/logind-user-dbus.c @@ -208,7 +208,7 @@ int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_er if (r == 0) return 1; /* Will call us back */ - r = user_stop(u, /* force= */ true); + r = user_stop(u, /* force = */ true); if (r < 0) return r; diff --git a/src/login/logind.c b/src/login/logind.c index 8f16eeabb76..65bc854f4ed 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -580,7 +580,7 @@ static int manager_enumerate_fds(Manager *m, int *ret_varlink_fd) { assert(m); assert(ret_varlink_fd); - n = sd_listen_fds_with_names(/* unset_environment= */ true, &fdnames); + n = sd_listen_fds_with_names(/* unset_environment = */ true, &fdnames); if (n < 0) return log_error_errno(n, "Failed to acquire passed fd list: %m"); @@ -880,7 +880,7 @@ static int manager_vt_switch(sd_event_source *src, const struct signalfd_siginfo return 0; } - r = vt_release(fd, /* restore= */ true); + r = vt_release(fd, /* restore = */ true); if (r < 0) log_warning_errno(r, "Failed to release current VT, ignoring: %m"); @@ -982,7 +982,7 @@ static int manager_connect_udev(Manager *m) { return r; FOREACH_STRING(s, "input", "graphics", "drm") { - r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, s, /* devtype= */ NULL); + r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, s, /* devtype = */ NULL); if (r < 0) return r; } @@ -1076,7 +1076,7 @@ static void manager_gc(Manager *m, bool drop_not_started) { seat->in_gc_queue = false; if (seat_may_gc(seat, drop_not_started)) { - seat_stop(seat, /* force= */ false); + seat_stop(seat, /* force = */ false); seat_free(seat); } } @@ -1087,7 +1087,7 @@ static void manager_gc(Manager *m, bool drop_not_started) { /* First, if we are not closing yet, initiate stopping. */ if (session_may_gc(session, drop_not_started) && session_get_state(session) != SESSION_CLOSING) - (void) session_stop(session, /* force= */ false); + (void) session_stop(session, /* force = */ false); /* Normally, this should make the session referenced again, if it doesn't then let's get rid * of it immediately. */ diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 173da87e273..ce6e5e137eb 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -1219,7 +1219,7 @@ static int register_session( handle, ur, c, - /* avoid_pidfd= */ false, + /* avoid_pidfd = */ false, &m); if (r < 0) return pam_bus_log_create_error(handle, r); @@ -1236,7 +1236,7 @@ static int register_session( handle, ur, c, - /* avoid_pidfd= */ true, + /* avoid_pidfd = */ true, &m); if (r < 0) return pam_bus_log_create_error(handle, r); @@ -1263,7 +1263,7 @@ static int register_session( &id, &object_path, &runtime_path, - /* session_fd= */ NULL, + /* session_fd = */ NULL, &original_uid, &real_seat, &real_vtnr, diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c index 70774dcdd1b..87adc892e19 100644 --- a/src/machine-id-setup/machine-id-setup-main.c +++ b/src/machine-id-setup/machine-id-setup-main.c @@ -189,7 +189,7 @@ static int run(int argc, char *argv[]) { } else { sd_id128_t id; - r = machine_id_setup(arg_root, SD_ID128_NULL, /* flags= */ 0, &id); + r = machine_id_setup(arg_root, SD_ID128_NULL, /* flags = */ 0, &id); if (r < 0) return r; diff --git a/src/machine/image-varlink.c b/src/machine/image-varlink.c index 908952dcf57..141261eaaed 100644 --- a/src/machine/image-varlink.c +++ b/src/machine/image-varlink.c @@ -322,7 +322,7 @@ static int clean_pool_done_internal(Operation *operation, FILE *file, int child_ assert(operation); assert(operation->link); - r = clean_pool_read_first_entry(file, child_error, /* error= */ NULL); + r = clean_pool_read_first_entry(file, child_error, /* error = */ NULL); if (r < 0) return log_debug_errno(r, "Failed to read first entry from tmp file: %m"); @@ -340,7 +340,7 @@ static int clean_pool_done_internal(Operation *operation, FILE *file, int child_ break; if (previous_name) { - r = clean_pool_list_one_image(operation->link, previous_name, previous_usage, /* more= */ true); + r = clean_pool_list_one_image(operation->link, previous_name, previous_usage, /* more = */ true); if (r < 0) return r; /* freeing memory to avoid memleak at the following assignment */ @@ -352,7 +352,7 @@ static int clean_pool_done_internal(Operation *operation, FILE *file, int child_ } if (previous_name) - return clean_pool_list_one_image(operation->link, previous_name, previous_usage, /* more= */ false); + return clean_pool_list_one_image(operation->link, previous_name, previous_usage, /* more = */ false); return sd_varlink_error(operation->link, "io.systemd.MachineImage.NoSuchImage", NULL); } diff --git a/src/machine/image.c b/src/machine/image.c index 0abee746db6..0a5b6d27ae0 100644 --- a/src/machine/image.c +++ b/src/machine/image.c @@ -120,7 +120,7 @@ int image_clean_pool_operation(Manager *manager, ImageCleanPoolMode mode, Operat errno_pipe_fd[0] = safe_close(errno_pipe_fd[0]); _cleanup_hashmap_free_ Hashmap *images = NULL; - r = image_discover(manager->runtime_scope, IMAGE_MACHINE, /* root= */ NULL, &images); + r = image_discover(manager->runtime_scope, IMAGE_MACHINE, /* root = */ NULL, &images); if (r < 0) { log_debug_errno(r, "Failed to discover images: %m"); report_errno_and_exit(errno_pipe_fd[1], r); diff --git a/src/machine/machine-varlink.c b/src/machine/machine-varlink.c index a499dbc3be2..1551608a68d 100644 --- a/src/machine/machine-varlink.c +++ b/src/machine/machine-varlink.c @@ -579,7 +579,7 @@ int vl_method_open(sd_varlink *link, sd_json_variant *parameters, sd_varlink_met break; case MACHINE_OPEN_MODE_LOGIN: - r = machine_start_getty(machine, ptmx_name, /* error= */ NULL); + r = machine_start_getty(machine, ptmx_name, /* error = */ NULL); if (r == -ENOENT) return sd_varlink_error(link, VARLINK_ERROR_MACHINE_NO_IPC, NULL); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) @@ -591,7 +591,7 @@ int vl_method_open(sd_varlink *link, sd_json_variant *parameters, sd_varlink_met case MACHINE_OPEN_MODE_SHELL: { assert(user && path && args); /* to avoid gcc complaining about possible uninitialized variables */ - r = machine_start_shell(machine, ptmx_fd, ptmx_name, user, path, args, p.env, /* error= */ NULL); + r = machine_start_shell(machine, ptmx_fd, ptmx_name, user, path, args, p.env, /* error = */ NULL); if (r == -ENOENT) return sd_varlink_error(link, VARLINK_ERROR_MACHINE_NO_IPC, NULL); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) diff --git a/src/machine/machine.c b/src/machine/machine.c index 281f377b3e9..89d6fa02339 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -509,7 +509,7 @@ static int machine_start_scope( * doesn't support PIDFDs yet, let's try without. */ if (allow_pidfd && sd_bus_error_has_names(&e, SD_BUS_ERROR_UNKNOWN_PROPERTY, SD_BUS_ERROR_PROPERTY_READ_ONLY)) - return machine_start_scope(machine, /* allow_pidfd= */ false, more_properties, error); + return machine_start_scope(machine, /* allow_pidfd = */ false, more_properties, error); return sd_bus_error_move(error, &e); } @@ -532,7 +532,7 @@ static int machine_ensure_scope(Machine *m, sd_bus_message *properties, sd_bus_e assert(m->class != MACHINE_HOST); if (!m->unit) { - r = machine_start_scope(m, /* allow_pidfd= */ true, properties, error); + r = machine_start_scope(m, /* allow_pidfd = */ true, properties, error); if (r < 0) return log_error_errno(r, "Failed to start machine scope: %s", bus_error_message(error, r)); } @@ -928,7 +928,7 @@ int machine_start_getty(Machine *m, const char *ptmx_name, sd_bus_error *error) container_bus = allocated_bus ?: m->manager->system_bus; getty = strjoina("container-getty@", p, ".service"); - r = bus_call_method(container_bus, bus_systemd_mgr, "StartUnit", error, /* ret_reply= */ NULL, "ss", getty, "replace"); + r = bus_call_method(container_bus, bus_systemd_mgr, "StartUnit", error, /* ret_reply = */ NULL, "ss", getty, "replace"); if (r < 0) return log_debug_errno(r, "Failed to StartUnit '%s' in container '%s': %m", getty, m->name); @@ -1183,14 +1183,14 @@ int machine_copy_from_to_operation( r = namespace_fork("(sd-copyns)", "(sd-copy)", - /* except_fds= */ NULL, - /* n_except_fds= */ 0, + /* except_fds = */ NULL, + /* n_except_fds = */ 0, FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL, - /* pidns_fd= */ -EBADF, + /* pidns_fd = */ -EBADF, target_mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF, + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF, &child); if (r < 0) return log_debug_errno(r, "Failed to fork into mount namespace of machine '%s': %m", machine->name); @@ -1223,8 +1223,8 @@ int machine_copy_from_to_operation( uid_shift == 0 ? UID_INVALID : 0, uid_shift == 0 ? GID_INVALID : 0, copy_flags, - /* denylist= */ NULL, - /* subvolumes= */ NULL); + /* denylist = */ NULL, + /* subvolumes = */ NULL); else r = copy_tree_at( host_fd, @@ -1234,8 +1234,8 @@ int machine_copy_from_to_operation( uid_shift == 0 ? UID_INVALID : uid_shift, uid_shift == 0 ? GID_INVALID : uid_shift, copy_flags, - /* denylist= */ NULL, - /* subvolumes= */ NULL); + /* denylist = */ NULL, + /* subvolumes = */ NULL); if (r < 0) log_debug_errno(r, "Failed to copy tree: %m"); @@ -1536,10 +1536,10 @@ int machine_open_root_directory(Machine *machine) { pid_t child; r = pidref_namespace_open(&machine->leader, - /* ret_pidns_fd= */ NULL, + /* ret_pidns_fd = */ NULL, &mntns_fd, - /* ret_netns_fd= */ NULL, - /* ret_userns_fd= */ NULL, + /* ret_netns_fd = */ NULL, + /* ret_userns_fd = */ NULL, &root_fd); if (r < 0) return log_debug_errno(r, "Failed to open mount namespace of machine '%s': %m", machine->name); @@ -1553,13 +1553,13 @@ int machine_open_root_directory(Machine *machine) { r = namespace_fork( "(sd-openrootns)", "(sd-openroot)", - /* except_fds= */ NULL, - /* n_except_fds= */ 0, + /* except_fds = */ NULL, + /* n_except_fds = */ 0, FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL, - /* pidns_fd= */ -EBADF, + /* pidns_fd = */ -EBADF, mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, root_fd, &child); if (r < 0) @@ -1576,7 +1576,7 @@ int machine_open_root_directory(Machine *machine) { report_errno_and_exit(errno_pipe_fd[1], -errno); } - r = send_one_fd(fd_pass_socket[1], dfd, /* flags= */ 0); + r = send_one_fd(fd_pass_socket[1], dfd, /* flags = */ 0); dfd = safe_close(dfd); if (r < 0) { log_debug_errno(r, "Failed to send FD over socket: %m"); @@ -1589,7 +1589,7 @@ int machine_open_root_directory(Machine *machine) { errno_pipe_fd[1] = safe_close(errno_pipe_fd[1]); fd_pass_socket[1] = safe_close(fd_pass_socket[1]); - r = wait_for_terminate_and_check("(sd-openrootns)", child, /* flags= */ 0); + r = wait_for_terminate_and_check("(sd-openrootns)", child, /* flags = */ 0); if (r < 0) return log_debug_errno(r, "Failed to wait for child: %m"); diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 9b2056918c0..cf8f7d48b9f 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -642,15 +642,15 @@ static void print_machine_status_info(sd_bus *bus, MachineStatusInfo *i) { show_journal_by_unit( stdout, i->unit, - /* namespace= */ NULL, + /* namespace = */ NULL, arg_output, - /* n_columns= */ 0, + /* n_columns = */ 0, i->timestamp.monotonic, arg_lines, get_output_flags() | OUTPUT_BEGIN_NEWLINE, SD_JOURNAL_LOCAL_ONLY, - /* system_unit= */ true, - /* ellipsized= */ NULL); + /* system_unit = */ true, + /* ellipsized = */ NULL); } } @@ -1472,7 +1472,7 @@ static int shell_machine(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_parse_error(r); - return process_forward(event, slot, master, /* flags= */ 0, machine); + return process_forward(event, slot, master, /* flags = */ 0, machine); } static int normalize_nspawn_filename(const char *name, char **ret_file) { @@ -1607,7 +1607,7 @@ static int cat_settings(int argc, char *argv[], void *userdata) { "Invalid settings file path '%s'.", *name); - q = cat_files(*name, /* dropins= */ NULL, /* flags= */ CAT_FORMAT_HAS_SECTIONS); + q = cat_files(*name, /* dropins = */ NULL, /* flags = */ CAT_FORMAT_HAS_SECTIONS); if (q < 0) return r < 0 ? r : q; continue; @@ -1628,7 +1628,7 @@ static int cat_settings(int argc, char *argv[], void *userdata) { return r < 0 ? r : q; } - q = cat_files(path, /* dropins= */ NULL, /* flags= */ CAT_FORMAT_HAS_SECTIONS); + q = cat_files(path, /* dropins = */ NULL, /* flags = */ CAT_FORMAT_HAS_SECTIONS); if (q < 0) return r < 0 ? r : q; } @@ -1904,7 +1904,7 @@ static int enable_machine(int argc, char *argv[], void *userdata) { if (!new_args) return log_oom(); - r = strv_extend_strv(&new_args, argv + 1, /* filter_duplicates= */ false); + r = strv_extend_strv(&new_args, argv + 1, /* filter_duplicates = */ false); if (r < 0) return log_oom(); diff --git a/src/machine/machined-core.c b/src/machine/machined-core.c index a262efb7988..8a9e4f6dc40 100644 --- a/src/machine/machined-core.c +++ b/src/machine/machined-core.c @@ -217,7 +217,7 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses _cleanup_free_ struct local_address *addresses = NULL; int n; - n = local_addresses(/* context= */ NULL, /* ifindex= */ 0, AF_UNSPEC, &addresses); + n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); if (n < 0) return log_debug_errno(n, "Failed to get local addresses: %m"); @@ -231,18 +231,18 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses pid_t child; int r; - r = pidref_in_same_namespace(/* pid1= */ NULL, &machine->leader, NAMESPACE_NET); + r = pidref_in_same_namespace(/* pid1 = */ NULL, &machine->leader, NAMESPACE_NET); if (r < 0) return log_debug_errno(r, "Failed to check if container has private network: %m"); if (r > 0) return -ENONET; r = pidref_namespace_open(&machine->leader, - /* ret_pidns_fd= */ NULL, - /* ret_mntns_fd= */ NULL, + /* ret_pidns_fd = */ NULL, + /* ret_mntns_fd = */ NULL, &netns_fd, - /* ret_userns_fd= */ NULL, - /* ret_root_fd= */ NULL); + /* ret_userns_fd = */ NULL, + /* ret_root_fd = */ NULL); if (r < 0) return log_debug_errno(r, "Failed to open namespace: %m"); @@ -251,14 +251,14 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses r = namespace_fork("(sd-addrns)", "(sd-addr)", - /* except_fds= */ NULL, - /* n_except_fds= */ 0, + /* except_fds = */ NULL, + /* n_except_fds = */ 0, FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL, - /* pidns_fd= */ -EBADF, - /* mntns_fd= */ -EBADF, + /* pidns_fd = */ -EBADF, + /* mntns_fd = */ -EBADF, netns_fd, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF, + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF, &child); if (r < 0) return log_debug_errno(r, "Failed to fork(): %m"); @@ -267,7 +267,7 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses pair[0] = safe_close(pair[0]); - int n = local_addresses(/* context= */ NULL, /* ifindex= */ 0, AF_UNSPEC, &addresses); + int n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); if (n < 0) { log_debug_errno(n, "Failed to get local addresses: %m"); _exit(EXIT_FAILURE); @@ -313,7 +313,7 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses return log_debug_errno(r, "Failed to add local address: %m"); } - r = wait_for_terminate_and_check("(sd-addrns)", child, /* flags= */ 0); + r = wait_for_terminate_and_check("(sd-addrns)", child, /* flags = */ 0); if (r < 0) return log_debug_errno(r, "Failed to wait for child: %m"); if (r != EXIT_SUCCESS) @@ -340,7 +340,7 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { switch (machine->class) { case MACHINE_HOST: - r = load_os_release_pairs(/* root= */ NULL, &l); + r = load_os_release_pairs(/* root = */ NULL, &l); if (r < 0) return log_debug_errno(r, "Failed to load OS release information: %m"); @@ -355,8 +355,8 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { r = pidref_namespace_open(&machine->leader, &pidns_fd, &mntns_fd, - /* ret_netns_fd= */ NULL, - /* ret_userns_fd= */ NULL, + /* ret_netns_fd = */ NULL, + /* ret_userns_fd = */ NULL, &root_fd); if (r < 0) return log_debug_errno(r, "Failed to open namespace: %m"); @@ -366,13 +366,13 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { r = namespace_fork("(sd-osrelns)", "(sd-osrel)", - /* except_fds= */ NULL, - /* n_except_fds= */ 0, + /* except_fds = */ NULL, + /* n_except_fds = */ 0, FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL, pidns_fd, mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, root_fd, &child); if (r < 0) @@ -382,7 +382,7 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { pair[0] = safe_close(pair[0]); - r = open_os_release(/* root= */ NULL, /* ret_path= */ NULL, &fd); + r = open_os_release(/* root = */ NULL, /* ret_path = */ NULL, &fd); if (r == -ENOENT) _exit(EXIT_NOT_FOUND); if (r < 0) { @@ -390,7 +390,7 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { _exit(EXIT_FAILURE); } - r = copy_bytes(fd, pair[1], UINT64_MAX, /* copy_flags= */ 0); + r = copy_bytes(fd, pair[1], UINT64_MAX, /* copy_flags = */ 0); if (r < 0) { log_debug_errno(r, "Failed to write to fd: %m"); _exit(EXIT_FAILURE); @@ -409,7 +409,7 @@ int machine_get_os_release(Machine *machine, char ***ret_os_release) { if (r < 0) return log_debug_errno(r, "Failed to load OS release information: %m"); - r = wait_for_terminate_and_check("(sd-osrelns)", child, /* flags= */ 0); + r = wait_for_terminate_and_check("(sd-osrelns)", child, /* flags = */ 0); if (r < 0) return log_debug_errno(r, "Failed to wait for child: %m"); if (r == EXIT_NOT_FOUND) diff --git a/src/machine/machined-varlink.c b/src/machine/machined-varlink.c index 56abcb9438b..f83cbb85626 100644 --- a/src/machine/machined-varlink.c +++ b/src/machine/machined-varlink.c @@ -546,7 +546,7 @@ static int vl_method_list(sd_varlink *link, sd_json_variant *parameters, sd_varl if (r < 0) return r; - return list_machine_one_and_maybe_read_metadata(link, machine, /* more= */ false, p.acquire_metadata); + return list_machine_one_and_maybe_read_metadata(link, machine, /* more = */ false, p.acquire_metadata); } if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE)) @@ -555,7 +555,7 @@ static int vl_method_list(sd_varlink *link, sd_json_variant *parameters, sd_varl Machine *previous = NULL, *i; HASHMAP_FOREACH(i, m->machines) { if (previous) { - r = list_machine_one_and_maybe_read_metadata(link, previous, /* more= */ true, p.acquire_metadata); + r = list_machine_one_and_maybe_read_metadata(link, previous, /* more = */ true, p.acquire_metadata); if (r < 0) return r; } @@ -564,7 +564,7 @@ static int vl_method_list(sd_varlink *link, sd_json_variant *parameters, sd_varl } if (previous) - return list_machine_one_and_maybe_read_metadata(link, previous, /* more= */ false, p.acquire_metadata); + return list_machine_one_and_maybe_read_metadata(link, previous, /* more = */ false, p.acquire_metadata); return sd_varlink_error(link, VARLINK_ERROR_MACHINE_NO_SUCH_MACHINE, NULL); } @@ -608,11 +608,11 @@ static int vl_method_terminate(sd_varlink *link, sd_json_variant *parameters, sd } static int vl_method_copy_from(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) { - return vl_method_copy_internal(link, parameters, flags, userdata, /* copy_from= */ true); + return vl_method_copy_internal(link, parameters, flags, userdata, /* copy_from = */ true); } static int vl_method_copy_to(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) { - return vl_method_copy_internal(link, parameters, flags, userdata, /* copy_from= */ false); + return vl_method_copy_internal(link, parameters, flags, userdata, /* copy_from = */ false); } static int vl_method_open_root_directory(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) { @@ -697,27 +697,27 @@ static int vl_method_list_images(sd_varlink *link, sd_json_variant *parameters, if (!image_name_is_valid(p.image_name)) return sd_varlink_error_invalid_parameter_name(link, "name"); - r = image_find(m->runtime_scope, IMAGE_MACHINE, p.image_name, /* root= */ NULL, &found); + r = image_find(m->runtime_scope, IMAGE_MACHINE, p.image_name, /* root = */ NULL, &found); if (r == -ENOENT) return sd_varlink_error(link, VARLINK_ERROR_MACHINE_IMAGE_NO_SUCH_IMAGE, NULL); if (r < 0) return log_debug_errno(r, "Failed to find image: %m"); - return list_image_one_and_maybe_read_metadata(m, link, found, /* more= */ false, p.acquire_metadata); + return list_image_one_and_maybe_read_metadata(m, link, found, /* more = */ false, p.acquire_metadata); } if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE)) return sd_varlink_error(link, SD_VARLINK_ERROR_EXPECTED_MORE, NULL); _cleanup_hashmap_free_ Hashmap *images = NULL; - r = image_discover(m->runtime_scope, IMAGE_MACHINE, /* root= */ NULL, &images); + r = image_discover(m->runtime_scope, IMAGE_MACHINE, /* root = */ NULL, &images); if (r < 0) return log_debug_errno(r, "Failed to discover images: %m"); Image *image, *previous = NULL; HASHMAP_FOREACH(image, images) { if (previous) { - r = list_image_one_and_maybe_read_metadata(m, link, previous, /* more= */ true, p.acquire_metadata); + r = list_image_one_and_maybe_read_metadata(m, link, previous, /* more = */ true, p.acquire_metadata); if (r < 0) return r; } @@ -726,7 +726,7 @@ static int vl_method_list_images(sd_varlink *link, sd_json_variant *parameters, } if (previous) - return list_image_one_and_maybe_read_metadata(m, link, previous, /* more= */ false, p.acquire_metadata); + return list_image_one_and_maybe_read_metadata(m, link, previous, /* more = */ false, p.acquire_metadata); return sd_varlink_error(link, VARLINK_ERROR_MACHINE_IMAGE_NO_SUCH_IMAGE, NULL); } diff --git a/src/machine/operation.c b/src/machine/operation.c index 8c43cc200f3..4e85006b855 100644 --- a/src/machine/operation.c +++ b/src/machine/operation.c @@ -84,7 +84,7 @@ static int operation_done(sd_event_source *s, const siginfo_t *si, void *userdat * an error on failure or an empty success message on success. */ if (o->done) - (void) o->done(o, r, /* error= */ NULL); + (void) o->done(o, r, /* error = */ NULL); else if (r < 0) (void) sd_varlink_error_errno(o->link, r); else diff --git a/src/measure/measure-tool.c b/src/measure/measure-tool.c index 515e7588b07..1cc681f9733 100644 --- a/src/measure/measure-tool.c +++ b/src/measure/measure-tool.c @@ -297,7 +297,7 @@ static int parse_argv(int argc, char *argv[]) { _cleanup_free_ char *device = NULL; if (streq(optarg, "list")) - return tpm2_list_devices(/* legend= */ true, /* quiet= */ false); + return tpm2_list_devices(/* legend = */ true, /* quiet = */ false); if (!streq(optarg, "auto")) { device = strdup(optarg); @@ -832,7 +832,7 @@ static int build_policy_digest(bool sign) { /* This must be done before openssl_load_private_key() otherwise it will get stuck */ if (arg_certificate) { if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index a42e1222cf5..4d5d136b2fb 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -79,7 +79,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (proc_cmdline_value_missing(key, value)) return 0; - r = strv_split_and_extend(&arg_proc_cmdline_modules, value, ",", /* filter_duplicates= */ true); + r = strv_split_and_extend(&arg_proc_cmdline_modules, value, ",", /* filter_duplicates = */ true); if (r < 0) return log_error_errno(r, "Failed to parse modules_load= kernel command line option: %m"); } @@ -151,7 +151,7 @@ static int do_direct_probe(OrderedSet *module_set) { return log_error_errno(r, "Failed to initialize libkmod context: %m"); ORDERED_SET_FOREACH(module, module_set) { - r = module_load_and_warn(ctx, module, /* verbose= */ true); + r = module_load_and_warn(ctx, module, /* verbose = */ true); if (r != -ENOENT) RET_GATHER(ret, r); } @@ -165,7 +165,7 @@ static int enqueue_module_to_load(int sock, const char *module) { assert(sock >= 0); assert(module); - bytes = send(sock, module, strlen(module), /* flags= */ 0); + bytes = send(sock, module, strlen(module), /* flags = */ 0); if (bytes < 0) return log_error_errno(errno, "Failed to send '%s' to thread pool: %m", module); @@ -180,7 +180,7 @@ static int dequeue_module_to_load(int sock, char *buffer, size_t buffer_len) { /* Dequeue one module to be loaded from the socket pair. In case no more * modules are present, recv() will return 0. */ - bytes = recv(sock, buffer, buffer_len, /* flags= */ 0); + bytes = recv(sock, buffer, buffer_len, /* flags = */ 0); if (bytes == 0) return 0; if (bytes < 0) @@ -217,7 +217,7 @@ static int run_prober(int sock) { break; } - r = module_load_and_warn(ctx, buffer, /* verbose= */ true); + r = module_load_and_warn(ctx, buffer, /* verbose = */ true); if (r != -ENOENT) RET_GATHER(ret, r); } @@ -257,7 +257,7 @@ static int create_worker_threads(size_t n_threads, void *arg, pthread_t **ret_th return log_error_errno(r, "Failed to mask signals for workers: %m"); for (created_threads = 0; created_threads < n_threads; ++created_threads) { - r = pthread_create(&new_threads[created_threads], /* attr= */ NULL, prober_thread, arg); + r = pthread_create(&new_threads[created_threads], /* attr = */ NULL, prober_thread, arg); if (r != 0) { log_error_errno(r, "Failed to create worker thread %zu: %m", created_threads); break; @@ -403,7 +403,7 @@ static int run(int argc, char *argv[]) { umask(0022); - r = proc_cmdline_parse(parse_proc_cmdline_item, /* userdata= */ NULL, PROC_CMDLINE_STRIP_RD_PREFIX); + r = proc_cmdline_parse(parse_proc_cmdline_item, /* userdata = */ NULL, PROC_CMDLINE_STRIP_RD_PREFIX); if (r < 0) log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m"); @@ -422,7 +422,7 @@ static int run(int argc, char *argv[]) { STRV_FOREACH(i, arg_proc_cmdline_modules) RET_GATHER(ret, modules_list_append_dup(&module_set, *i)); - r = conf_files_list_nulstr_full(".conf", /* root= */ NULL, + r = conf_files_list_nulstr_full(".conf", /* root = */ NULL, CONF_FILES_REGULAR | CONF_FILES_FILTER_MASKED, conf_file_dirs, &files, &n_files); if (r < 0) @@ -442,7 +442,7 @@ static int run(int argc, char *argv[]) { } /* Create a socketpair for communication with probe workers */ - r = RET_NERRNO(socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, /* protocol= */ 0, pair)); + r = RET_NERRNO(socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, /* protocol = */ 0, pair)); if (r < 0) return log_error_errno(r, "Failed to create socket pair: %m"); diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index eae5512efc3..10a2ad7ad46 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -505,7 +505,7 @@ static int parse_argv(int argc, char *argv[]) { _cleanup_free_ char *dev_bound = NULL; r = fstab_filter_options(arg_mount_options, "x-systemd.device-bound\0", - /* ret_namefound= */ NULL, &dev_bound, /* ret_values= */ NULL, /* ret_filtered= */ NULL); + /* ret_namefound = */ NULL, &dev_bound, /* ret_values = */ NULL, /* ret_filtered = */ NULL); if (r < 0) return log_error_errno(r, "Failed to parse mount options for x-systemd.device-bound=: %m"); if (r > 0 && !isempty(dev_bound)) { @@ -852,7 +852,7 @@ static int find_mount_points_by_source(const char *what, char ***ret) { /* Obtain all mount points with source being "what" from /proc/self/mountinfo, return value shows * the total number of them. */ - r = libmount_parse_mountinfo(/* source= */ NULL, &table, &iter); + r = libmount_parse_mountinfo(/* source = */ NULL, &table, &iter); if (r < 0) return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m"); @@ -894,7 +894,7 @@ static int find_loop_device(const char *backing_file, sd_device **ret) { if (r < 0) return log_oom(); - r = sd_device_enumerator_add_match_subsystem(e, "block", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "block", /* match = */ true); if (r < 0) return log_error_errno(r, "Failed to add subsystem match: %m"); @@ -906,7 +906,7 @@ static int find_loop_device(const char *backing_file, sd_device **ret) { if (r < 0) return log_error_errno(r, "Failed to add sysname match: %m"); - r = sd_device_enumerator_add_match_sysattr(e, "loop/backing_file", /* value= */ NULL, /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(e, "loop/backing_file", /* value = */ NULL, /* match = */ true); if (r < 0) return log_error_errno(r, "Failed to add sysattr match: %m"); diff --git a/src/network/fuzz-netdev-parser.c b/src/network/fuzz-netdev-parser.c index 22f35a4c8e0..b7e3598fec3 100644 --- a/src/network/fuzz-netdev-parser.c +++ b/src/network/fuzz-netdev-parser.c @@ -21,7 +21,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { assert_se(fwrite(data, size, 1, f) == 1); fflush(f); - assert_se(manager_new(&manager, /* test_mode= */ true) >= 0); + assert_se(manager_new(&manager, /* test_mode = */ true) >= 0); (void) netdev_load_one(manager, netdev_config, &netdev); return 0; } diff --git a/src/network/fuzz-network-parser.c b/src/network/fuzz-network-parser.c index 4154c6b1b3e..9e5cedc3cf7 100644 --- a/src/network/fuzz-network-parser.c +++ b/src/network/fuzz-network-parser.c @@ -20,7 +20,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { assert_se(fwrite(data, size, 1, f) == 1); fflush(f); - assert_se(manager_new(&manager, /* test_mode= */ true) >= 0); + assert_se(manager_new(&manager, /* test_mode = */ true) >= 0); (void) network_load_one(manager, &manager->networks, network_config); return 0; } diff --git a/src/network/netdev/l2tp-tunnel.c b/src/network/netdev/l2tp-tunnel.c index 1afe109c1b1..fba015bcc22 100644 --- a/src/network/netdev/l2tp-tunnel.c +++ b/src/network/netdev/l2tp-tunnel.c @@ -297,7 +297,7 @@ static int l2tp_get_local_address(NetDev *netdev, union in_addr_union *ret) { if (r < 0) return r; - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return -EBUSY; } @@ -351,7 +351,7 @@ static int l2tp_get_local_address(NetDev *netdev, union in_addr_union *ret) { return link_get_l2tp_local_address(link, t, ret); HASHMAP_FOREACH(link, netdev->manager->links_by_index) { - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) continue; if (link_get_l2tp_local_address(link, t, ret) >= 0) diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c index 0b999b4b8a6..7f6ce3ed3de 100644 --- a/src/network/netdev/macsec.c +++ b/src/network/netdev/macsec.c @@ -743,7 +743,7 @@ int config_parse_macsec_key( dest = a ? &a->sa : &b->sa; - r = unhexmem_full(rvalue, SIZE_MAX, /* secure= */ true, &p, &l); + r = unhexmem_full(rvalue, SIZE_MAX, /* secure = */ true, &p, &l); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse key. Ignoring assignment: %m"); return 0; diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 250b6cf7bcd..0bcde609a8f 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -103,7 +103,7 @@ Tunnel.ERSPANHardwareId, config_parse_erspan_hwid, Tunnel.SerializeTunneledPackets, config_parse_tristate, 0, offsetof(Tunnel, gre_erspan_sequence) Tunnel.ISATAP, config_parse_tristate, 0, offsetof(Tunnel, isatap) Tunnel.External, config_parse_bool, 0, offsetof(Tunnel, external) -FooOverUDP.Protocol, config_parse_ip_protocol, /* relax= */ true, offsetof(FouTunnel, fou_protocol) +FooOverUDP.Protocol, config_parse_ip_protocol, /* relax = */ true, offsetof(FouTunnel, fou_protocol) FooOverUDP.Encapsulation, config_parse_fou_encap_type, 0, offsetof(FouTunnel, fou_encap_type) FooOverUDP.Port, config_parse_ip_port, 0, offsetof(FouTunnel, port) FooOverUDP.PeerPort, config_parse_ip_port, 0, offsetof(FouTunnel, peer_port) diff --git a/src/network/netdev/netdev-util.c b/src/network/netdev/netdev-util.c index 41a464eefce..d6cddf6bcb0 100644 --- a/src/network/netdev/netdev-util.c +++ b/src/network/netdev/netdev-util.c @@ -45,7 +45,7 @@ int link_get_local_address( assert_not_reached(); } - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return -EBUSY; SET_FOREACH(a, link->addresses) { diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c index 945b04e9670..d3e29c0c33e 100644 --- a/src/network/netdev/netdev.c +++ b/src/network/netdev/netdev.c @@ -827,7 +827,7 @@ static bool link_is_ready_to_create_stacked_netdev_one(Link *link, bool allow_un } static bool link_is_ready_to_create_stacked_netdev(Link *link) { - return check_ready_for_all_sr_iov_ports(link, /* allow_unmanaged= */ false, + return check_ready_for_all_sr_iov_ports(link, /* allow_unmanaged = */ false, link_is_ready_to_create_stacked_netdev_one); } @@ -1031,7 +1031,7 @@ int netdev_load_one(Manager *manager, const char *filename, NetDev **ret) { dropin_dirname = strjoina(file_basename, ".d"); r = config_parse_many( - STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root= */ NULL, + STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root = */ NULL, NETDEV_COMMON_SECTIONS NETDEV_OTHER_SECTIONS, config_item_perf_lookup, network_netdev_gperf_lookup, CONFIG_PARSE_WARN, @@ -1065,7 +1065,7 @@ int netdev_load_one(Manager *manager, const char *filename, NetDev **ret) { NETDEV_VTABLE(netdev)->init(netdev); r = config_parse_many( - STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root= */ NULL, + STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root = */ NULL, NETDEV_VTABLE(netdev)->sections, config_item_perf_lookup, network_netdev_gperf_lookup, CONFIG_PARSE_WARN, @@ -1086,7 +1086,7 @@ int netdev_load_one(Manager *manager, const char *filename, NetDev **ret) { if (!netdev->filename) return log_oom(); - log_syntax(/* unit= */ NULL, LOG_DEBUG, filename, /* config_line= */ 0, /* error= */ 0, "Successfully loaded."); + log_syntax(/* unit = */ NULL, LOG_DEBUG, filename, /* config_line = */ 0, /* error = */ 0, "Successfully loaded."); *ret = TAKE_PTR(netdev); return 0; diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c index 2ade2e783df..12eacab3779 100644 --- a/src/network/netdev/vxlan.c +++ b/src/network/netdev/vxlan.c @@ -316,7 +316,7 @@ int config_parse_port_range( VxLan *v = ASSERT_PTR(userdata); int r; - r = parse_ip_port_range(rvalue, &v->port_range.low, &v->port_range.high, /* allow_zero= */ false); + r = parse_ip_port_range(rvalue, &v->port_range.low, &v->port_range.high, /* allow_zero = */ false); if (r < 0) log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse VXLAN port range '%s'. Port should be greater than 0 and less than 65535.", rvalue); diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c index daf4ff458f2..1a731fc451f 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -511,7 +511,7 @@ static int wireguard_decode_key_and_warn( cred_name = startswith(rvalue, "@"); if (cred_name) { - r = read_credential(cred_name, (void**) &cred, /* ret_size= */ NULL); + r = read_credential(cred_name, (void**) &cred, /* ret_size = */ NULL); if (r == -ENOMEM) return log_oom(); if (r < 0) { @@ -524,7 +524,7 @@ static int wireguard_decode_key_and_warn( } else if (!streq(lvalue, "PublicKey")) (void) warn_file_is_world_accessible(filename, NULL, unit, line); - r = unbase64mem_full(cred ?: rvalue, SIZE_MAX, /* secure= */ true, &key, &len); + r = unbase64mem_full(cred ?: rvalue, SIZE_MAX, /* secure = */ true, &key, &len); if (r == -ENOMEM) return log_oom(); if (r < 0) { @@ -776,7 +776,7 @@ int config_parse_wireguard_endpoint( cred_name = startswith(rvalue, "@"); if (cred_name) { - r = read_credential(cred_name, (void**) &cred, /* ret_size= */ NULL); + r = read_credential(cred_name, (void**) &cred, /* ret_size = */ NULL); if (r == -ENOMEM) return log_oom(); if (r < 0) { @@ -1169,7 +1169,7 @@ static int wireguard_read_default_key_cred(NetDev *netdev, const char *filename) _cleanup_(erase_and_freep) char *cred = NULL; - r = read_credential(strjoina("network.wireguard.private.", config_name), (void**) &cred, /* ret_size= */ NULL); + r = read_credential(strjoina("network.wireguard.private.", config_name), (void**) &cred, /* ret_size = */ NULL); if (r < 0) return log_netdev_error_errno(netdev, r, "%s: No private key specified and default key isn't available, " @@ -1179,7 +1179,7 @@ static int wireguard_read_default_key_cred(NetDev *netdev, const char *filename) _cleanup_(erase_and_freep) void *key = NULL; size_t len; - r = unbase64mem_full(cred, SIZE_MAX, /* secure= */ true, &key, &len); + r = unbase64mem_full(cred, SIZE_MAX, /* secure = */ true, &key, &len); if (r < 0) return log_netdev_error_errno(netdev, r, "%s: No private key specified and default key cannot be parsed, " diff --git a/src/network/networkctl-config-file.c b/src/network/networkctl-config-file.c index e4c09b7f7cf..d82245d084d 100644 --- a/src/network/networkctl-config-file.c +++ b/src/network/networkctl-config-file.c @@ -106,7 +106,7 @@ static int get_config_files_by_name( if (!dropin_dirname) return -ENOMEM; - r = conf_files_list_dropins(ret_dropins, dropin_dirname, /* root= */ NULL, NETWORK_DIRS); + r = conf_files_list_dropins(ret_dropins, dropin_dirname, /* root = */ NULL, NETWORK_DIRS); if (r < 0) return r; } @@ -381,7 +381,7 @@ static int add_config_to_edit( if (!comment_paths) return log_oom(); - r = strv_extend_strv(&comment_paths, dropins, /* filter_duplicates= */ false); + r = strv_extend_strv(&comment_paths, dropins, /* filter_duplicates = */ false); if (r < 0) return log_oom(); @@ -416,7 +416,7 @@ static int udevd_reload(sd_bus *bus) { if (r < 0) return bus_log_parse_error(r); - r = bus_wait_for_jobs_one(w, job_path, /* flags= */ 0, NULL); + r = bus_wait_for_jobs_one(w, job_path, /* flags = */ 0, NULL); if (r == -ENOEXEC) { log_debug("systemd-udevd is not running, skipping reload."); return 0; @@ -505,7 +505,7 @@ int verb_edit(int argc, char *argv[], void *userdata) { "Config type 'all' cannot be used with 'edit'."); r = get_config_files_by_link_config(ifname, type, - /* ignore_missing= */ false, + /* ignore_missing = */ false, &rtnl, &path, &dropins); if (r < 0) @@ -530,7 +530,7 @@ int verb_edit(int argc, char *argv[], void *userdata) { else return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Network config of unknown type: %s", *name); - r = get_config_files_by_name(*name, /* allow_masked= */ false, &path, &dropins); + r = get_config_files_by_name(*name, /* allow_masked = */ false, &path, &dropins); if (r == -ERFKILL) return log_error_errno(r, "Network config '%s' is masked.", *name); if (r == -ENOENT) { @@ -588,7 +588,7 @@ static int cat_files_by_link_one( if (!*first) putchar('\n'); - r = cat_files(path, dropins, /* flags= */ CAT_FORMAT_HAS_SECTIONS); + r = cat_files(path, dropins, /* flags = */ CAT_FORMAT_HAS_SECTIONS); if (r < 0) return r; @@ -612,7 +612,7 @@ static int cat_files_by_link_config(const char *link_config, sd_netlink **rtnl, if (type == _CONFIG_MAX) { for (LinkConfigType i = 0; i < _CONFIG_MAX; i++) { - r = cat_files_by_link_one(ifname, i, rtnl, /* ignore_missing= */ true, first); + r = cat_files_by_link_one(ifname, i, rtnl, /* ignore_missing = */ true, first); if (r < 0) return r; } @@ -620,7 +620,7 @@ static int cat_files_by_link_config(const char *link_config, sd_netlink **rtnl, return 0; } - return cat_files_by_link_one(ifname, type, rtnl, /* ignore_missing= */ false, first); + return cat_files_by_link_one(ifname, type, rtnl, /* ignore_missing = */ false, first); } int verb_cat(int argc, char *argv[], void *userdata) { @@ -651,7 +651,7 @@ int verb_cat(int argc, char *argv[], void *userdata) { _cleanup_strv_free_ char **dropins = NULL; _cleanup_free_ char *path = NULL; - r = get_config_files_by_name(*name, /* allow_masked= */ false, &path, &dropins); + r = get_config_files_by_name(*name, /* allow_masked = */ false, &path, &dropins); if (r == -ENOENT) { RET_GATHER(ret, log_error_errno(r, "Cannot find network config file '%s'.", *name)); continue; @@ -666,7 +666,7 @@ int verb_cat(int argc, char *argv[], void *userdata) { if (!first) putchar('\n'); - r = cat_files(path, dropins, /* flags= */ CAT_FORMAT_HAS_SECTIONS); + r = cat_files(path, dropins, /* flags = */ CAT_FORMAT_HAS_SECTIONS); if (r < 0) return r; @@ -699,7 +699,7 @@ int verb_mask(int argc, char *argv[], void *userdata) { else return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Network config of unknown type: %s", *name); - r = get_config_files_by_name(*name, /* allow_masked= */ true, &config_path, /* ret_dropins= */ NULL); + r = get_config_files_by_name(*name, /* allow_masked = */ true, &config_path, /* ret_dropins = */ NULL); if (r == -ENOENT) log_warning("No existing network config '%s' found, proceeding anyway.", *name); else if (r < 0) @@ -758,7 +758,7 @@ int verb_unmask(int argc, char *argv[], void *userdata) { else return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Network config of unknown type: %s", *name); - r = get_config_files_by_name(*name, /* allow_masked= */ true, &path, /* ret_dropins= */ NULL); + r = get_config_files_by_name(*name, /* allow_masked = */ true, &path, /* ret_dropins = */ NULL); if (r == -ENOENT) { log_debug_errno(r, "Network configuration '%s' doesn't exist, skipping.", *name); continue; diff --git a/src/network/networkctl-description.c b/src/network/networkctl-description.c index 571044a3585..ec4bebbd652 100644 --- a/src/network/networkctl-description.c +++ b/src/network/networkctl-description.c @@ -19,11 +19,11 @@ static int dump_manager_description(sd_varlink *vl) { assert(vl); - r = varlink_call_and_log(vl, "io.systemd.Network.Describe", /* parameters= */ NULL, &v); + r = varlink_call_and_log(vl, "io.systemd.Network.Describe", /* parameters = */ NULL, &v); if (r < 0) return r; - r = sd_json_variant_dump(v, arg_json_format_flags, /* f= */ NULL, /* prefix= */ NULL); + r = sd_json_variant_dump(v, arg_json_format_flags, /* f = */ NULL, /* prefix = */ NULL); if (r < 0) return log_error_errno(r, "Failed to dump json object: %m"); return 0; @@ -38,7 +38,7 @@ static int dump_link_description(sd_varlink *vl, char * const *patterns) { assert(vl); assert(patterns); - r = varlink_call_and_log(vl, "io.systemd.Network.Describe", /* parameters= */ NULL, &v); + r = varlink_call_and_log(vl, "io.systemd.Network.Describe", /* parameters = */ NULL, &v); if (r < 0) return r; diff --git a/src/network/networkctl-util.c b/src/network/networkctl-util.c index 00996e689f7..37fa4835973 100644 --- a/src/network/networkctl-util.c +++ b/src/network/networkctl-util.c @@ -94,7 +94,7 @@ int acquire_bus(sd_bus **ret) { (void) sd_bus_set_allow_interactive_authorization(bus, arg_ask_password); if (networkd_is_running()) { - r = varlink_connect_networkd(/* ret_varlink= */ NULL); + r = varlink_connect_networkd(/* ret_varlink = */ NULL); if (r < 0) return r; } else diff --git a/src/network/networkd-address-generation.c b/src/network/networkd-address-generation.c index 5f28284e63f..c94ce750bca 100644 --- a/src/network/networkd-address-generation.c +++ b/src/network/networkd-address-generation.c @@ -344,7 +344,7 @@ static int generate_addresses( if (in6_addr_is_set(&j->address) && !in6_addr_equal(&j->address, &masked)) continue; - if (generate_stable_private_address(link, app_id, &j->secret_key, &masked, /* previous= */ NULL, &addr) < 0) + if (generate_stable_private_address(link, app_id, &j->secret_key, &masked, /* previous = */ NULL, &addr) < 0) continue; break; @@ -367,7 +367,7 @@ static int generate_addresses( r = generate_eui64_address(link, &masked, &addr); } else { type = ADDRESS_GENERATION_PREFIXSTABLE; - r = generate_stable_private_address(link, app_id, &SD_ID128_NULL, &masked, /* previous= */ NULL, &addr); + r = generate_stable_private_address(link, app_id, &SD_ID128_NULL, &masked, /* previous = */ NULL, &addr); } if (r < 0) return r; diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c index e55526dd7d7..124fc94e142 100644 --- a/src/network/networkd-address-label.c +++ b/src/network/networkd-address-label.c @@ -215,7 +215,7 @@ static int link_address_label_process_request(Request *req, Link *link, void *us assert(link); assert(link->manager); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return 0; if (!link->manager->static_address_labels_configured) diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 5bb4cddbdac..97d72788623 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -812,13 +812,13 @@ static int address_update(Address *address) { if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER)) return 0; - r = address_set_masquerade(address, /* add= */ true); + r = address_set_masquerade(address, /* add = */ true); if (r < 0) return log_link_warning_errno(link, r, "Could not enable IP masquerading: %m"); address_add_netlabel(address); - address_modify_nft_set(address, /* add= */ true); + address_modify_nft_set(address, /* add = */ true); if (address_is_ready(address) && address->callback) { r = address->callback(address); @@ -826,7 +826,7 @@ static int address_update(Address *address) { return r; } - link_update_operstate(link, /* also_update_master= */ true); + link_update_operstate(link, /* also_update_master = */ true); link_check_ready(link); return 0; } @@ -876,11 +876,11 @@ static int address_drop(Address *in, bool removed_by_us) { Link *link = ASSERT_PTR(address->link); int r; - r = address_set_masquerade(address, /* add= */ false); + r = address_set_masquerade(address, /* add = */ false); if (r < 0) log_link_warning_errno(link, r, "Failed to disable IP masquerading, ignoring: %m"); - address_modify_nft_set(address, /* add= */ false); + address_modify_nft_set(address, /* add = */ false); address_del_netlabel(address); @@ -901,7 +901,7 @@ static int address_drop(Address *in, bool removed_by_us) { } } - link_update_operstate(link, /* also_update_master= */ true); + link_update_operstate(link, /* also_update_master = */ true); link_check_ready(link); return 0; } @@ -1226,7 +1226,7 @@ static int address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, Remov r, "Could not drop address"); /* If the address cannot be removed, then assume the address is already removed. */ - address_forget(link, address, /* removed_by_us= */ true, "Forgetting"); + address_forget(link, address, /* removed_by_us = */ true, "Forgetting"); } return 1; @@ -1933,7 +1933,7 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message, if (type == RTM_DELADDR) { if (address) address_forget(link, address, - /* removed_by_us= */ FLAGS_SET(address->state, NETWORK_CONFIG_STATE_REMOVING), + /* removed_by_us = */ FLAGS_SET(address->state, NETWORK_CONFIG_STATE_REMOVING), "Forgetting removed"); else log_address_debug(tmp, "Kernel removed unknown", link); @@ -2074,8 +2074,8 @@ static int config_parse_broadcast( r = config_parse_in_addr_non_null( unit, filename, line, section, section_line, - lvalue, /* ltype= */ AF_INET, rvalue, - &address->broadcast, /* userdata= */ NULL); + lvalue, /* ltype = */ AF_INET, rvalue, + &address->broadcast, /* userdata = */ NULL); if (r <= 0) return r; @@ -2111,7 +2111,7 @@ static int config_parse_address( return 1; } - r = config_parse_in_addr_prefix(unit, filename, line, section, section_line, lvalue, /* ltype= */ true, rvalue, &prefix, /* userdata= */ NULL); + r = config_parse_in_addr_prefix(unit, filename, line, section, section_line, lvalue, /* ltype = */ true, rvalue, &prefix, /* userdata = */ NULL); if (r <= 0) return r; diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c index 9701811876e..0b3fb628604 100644 --- a/src/network/networkd-bridge-vlan.c +++ b/src/network/networkd-bridge-vlan.c @@ -55,7 +55,7 @@ static int add_range(sd_netlink_message *m, uint16_t begin, uint16_t end, bool u assert(end < BRIDGE_VLAN_BITMAP_MAX); if (begin == end) - return add_single(m, begin, untagged, /* is_pvid= */ false, str); + return add_single(m, begin, untagged, /* is_pvid = */ false, str); if (DEBUG_LOGGING) (void) strextendf_with_separator(str, ",", "%u-%u%s", begin, end, untagged ? "(untagged)" : ""); @@ -131,7 +131,7 @@ static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) { begin = UINT16_MAX; } - r = add_single(m, pvid, pvid_is_untagged, /* is_pvid= */ true, &str); + r = add_single(m, pvid, pvid_is_untagged, /* is_pvid = */ true, &str); if (r < 0) return r; @@ -207,7 +207,7 @@ static int bridge_vlan_append_del_info(Link *link, sd_netlink_message *m) { if (begin != UINT16_MAX) { assert(begin < k); - r = add_range(m, begin, k - 1, /* untagged= */ false, &str); + r = add_range(m, begin, k - 1, /* untagged = */ false, &str); if (r < 0) return r; diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c index 59ad2daaee3..1a5ccf1d20d 100644 --- a/src/network/networkd-dhcp-prefix-delegation.c +++ b/src/network/networkd-dhcp-prefix-delegation.c @@ -266,7 +266,7 @@ static int dhcp_pd_check_ready(Link *link) { log_link_debug(link, "DHCP-PD addresses and routes set."); - r = dhcp_pd_remove(link, /* only_marked= */ true); + r = dhcp_pd_remove(link, /* only_marked = */ true); if (r < 0) return r; @@ -611,7 +611,7 @@ static int dhcp_pd_finalize(Link *link) { if (link->dhcp_pd_messages == 0) { link->dhcp_pd_configured = false; - r = dhcp_pd_remove(link, /* only_marked= */ true); + r = dhcp_pd_remove(link, /* only_marked = */ true); if (r < 0) return r; } @@ -673,15 +673,15 @@ static void dhcp_pd_prefix_lost(Link *uplink, NetworkConfigSource source) { assert(uplink->manager); HASHMAP_FOREACH(link, uplink->manager->links_by_index) { - if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto= */ true)) + if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto = */ true)) continue; - r = dhcp_pd_remove(link, /* only_marked= */ false); + r = dhcp_pd_remove(link, /* only_marked = */ false); if (r < 0) link_enter_failed(link); } - (void) dhcp_pd_remove_unreachable_route(uplink->manager, source, /* only_marked= */ false); + (void) dhcp_pd_remove_unreachable_route(uplink->manager, source, /* only_marked = */ false); set_clear(uplink->dhcp_pd_prefixes); } @@ -977,7 +977,7 @@ static int dhcp4_pd_assign_subnet_prefix(Link *link, Link *uplink) { return r; } - r = dhcp_pd_assign_subnet_prefix(link, &pd_prefix, pd_prefixlen, lifetime_usec, lifetime_usec, /* is_uplink= */ false); + r = dhcp_pd_assign_subnet_prefix(link, &pd_prefix, pd_prefixlen, lifetime_usec, lifetime_usec, /* is_uplink = */ false); if (r < 0) return r; @@ -1054,7 +1054,7 @@ int dhcp4_pd_prefix_acquired(Link *uplink) { r = dhcp4_request_unreachable_route(uplink, &pd_prefix, pd_prefixlen, lifetime_usec, &server_address); if (r < 0) return r; - (void) dhcp_pd_remove_unreachable_route(uplink->manager, NETWORK_CONFIG_SOURCE_DHCP4, /* only_marked= */ true); + (void) dhcp_pd_remove_unreachable_route(uplink->manager, NETWORK_CONFIG_SOURCE_DHCP4, /* only_marked = */ true); /* Create or update 6rd SIT tunnel device. */ r = dhcp4_pd_create_6rd_tunnel(uplink, dhcp4_pd_6rd_tunnel_create_handler); @@ -1063,7 +1063,7 @@ int dhcp4_pd_prefix_acquired(Link *uplink) { /* Then, assign subnet prefixes to downstream interfaces. */ HASHMAP_FOREACH(link, uplink->manager->links_by_index) { - if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto= */ true)) + if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto = */ true)) continue; r = dhcp4_pd_assign_subnet_prefix(link, uplink); @@ -1117,7 +1117,7 @@ static int dhcp6_pd_assign_subnet_prefixes(Link *link, Link *uplink) { r = dhcp_pd_assign_subnet_prefix(link, &pd_prefix, pd_prefix_len, lifetime_preferred_usec, lifetime_valid_usec, - /* is_uplink= */ link == uplink); + /* is_uplink = */ link == uplink); if (r < 0) return r; } @@ -1170,11 +1170,11 @@ int dhcp6_pd_prefix_acquired(Link *uplink) { return r; } - (void) dhcp_pd_remove_unreachable_route(uplink->manager, NETWORK_CONFIG_SOURCE_DHCP6, /* only_marked= */ true); + (void) dhcp_pd_remove_unreachable_route(uplink->manager, NETWORK_CONFIG_SOURCE_DHCP6, /* only_marked = */ true); /* Then, assign subnet prefixes. */ HASHMAP_FOREACH(link, uplink->manager->links_by_index) { - if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto= */ true)) + if (!dhcp_pd_is_uplink(link, uplink, /* accept_auto = */ true)) continue; r = dhcp6_pd_assign_subnet_prefixes(link, uplink); @@ -1312,7 +1312,7 @@ int link_drop_dhcp_pd_config(Link *link, Network *network) { return 0; /* .network file is unchanged. It is not necessary to reconfigure the client. */ if (!link_dhcp_pd_is_enabled(link)) /* Disabled now, drop all configs. */ - return dhcp_pd_remove(link, /* only_marked= */ false); + return dhcp_pd_remove(link, /* only_marked = */ false); /* If previously explicitly disabled, then there is nothing we need to drop. * If this is called on start up, we do not know the previous settings, assume nothing changed. */ @@ -1328,7 +1328,7 @@ int link_drop_dhcp_pd_config(Link *link, Network *network) { link->network->dhcp_pd_route_metric != network->dhcp_pd_route_metric || link->network->dhcp_pd_uplink_index != network->dhcp_pd_uplink_index || !streq_ptr(link->network->dhcp_pd_uplink_name, network->dhcp_pd_uplink_name)) - return dhcp_pd_remove(link, /* only_marked= */ false); + return dhcp_pd_remove(link, /* only_marked = */ false); return 0; } diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c index 24ae1bbe890..7ab11332543 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -761,7 +761,7 @@ static bool dhcp_server_is_ready_to_configure(Link *link) { assert(link->network); assert(link->network->dhcp_server_address); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return false; if (!link_has_carrier(link)) diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 6ec8f8b2417..f88e6d58fc1 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -328,7 +328,7 @@ int dhcp4_check_ready(Link *link) { log_link_debug(link, "DHCPv4 address and routes set."); /* New address and routes are configured now. Let's release old lease. */ - r = dhcp4_remove_address_and_routes(link, /* only_marked= */ true); + r = dhcp4_remove_address_and_routes(link, /* only_marked = */ true); if (r < 0) return r; @@ -800,7 +800,7 @@ static int dhcp4_request_routes(Link *link) { assert(link); assert(link->dhcp_lease); - r = dhcp4_request_prefix_route(link, /* rt= */ NULL); + r = dhcp4_request_prefix_route(link, /* rt = */ NULL); if (r < 0) return log_link_error_errno(link, r, "DHCP error: Could not request prefix route: %m"); @@ -881,7 +881,7 @@ int dhcp4_lease_lost(Link *link) { sd_dhcp_lease_has_6rd(link->dhcp_lease)) dhcp4_pd_prefix_lost(link); - RET_GATHER(r, dhcp4_remove_address_and_routes(link, /* only_marked= */ false)); + RET_GATHER(r, dhcp4_remove_address_and_routes(link, /* only_marked = */ false)); RET_GATHER(r, dhcp_reset_mtu(link)); RET_GATHER(r, dhcp_reset_hostname(link)); @@ -1755,7 +1755,7 @@ int dhcp4_update_ipv6_connectivity(Link *link) { if (link_has_ipv6_connectivity(link)) return 0; - return dhcp4_start_full(link, /* set_ipv6_connectivity= */ false); + return dhcp4_start_full(link, /* set_ipv6_connectivity = */ false); } int dhcp4_start_full(Link *link, bool set_ipv6_connectivity) { @@ -1826,7 +1826,7 @@ static int dhcp4_process_request(Request *req, Link *link, void *userdata) { assert(link); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return 0; r = dhcp4_configure_duid(link); @@ -1882,7 +1882,7 @@ int link_drop_dhcp4_config(Link *link, Network *network) { * client was enabled on the previous invocation of networkd, but when it is restarted, a new * .network file may match to the interface, and DHCPv4 client may be disabled. In that case, * the DHCPv4 client is not running, hence sd_dhcp_client_stop() in the above does nothing. */ - RET_GATHER(ret, dhcp4_remove_address_and_routes(link, /* only_marked= */ false)); + RET_GATHER(ret, dhcp4_remove_address_and_routes(link, /* only_marked = */ false)); } if (link->dhcp_client && link->network->dhcp_use_bootp && diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 5da83d5aeb3..cae497278fb 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -46,7 +46,7 @@ static DHCP6ClientStartMode link_get_dhcp6_client_start_mode(Link *link) { return link->network->dhcp6_client_start_mode; /* When this interface itself is an uplink interface, then start dhcp6 client in solicit mode. */ - if (dhcp_pd_is_uplink(link, link, /* accept_auto= */ false)) + if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) return DHCP6_CLIENT_START_MODE_SOLICIT; /* Otherwise, start dhcp6 client when RA is received. */ @@ -125,7 +125,7 @@ int dhcp6_check_ready(Link *link) { link->dhcp6_configured = true; log_link_debug(link, "DHCPv6 addresses and routes set."); - r = dhcp6_remove(link, /* only_marked= */ true); + r = dhcp6_remove(link, /* only_marked = */ true); if (r < 0) return r; @@ -335,7 +335,7 @@ static int dhcp6_lease_ip_acquired(sd_dhcp6_client *client, Link *link) { if (link->dhcp6_messages == 0) { link->dhcp6_configured = true; - r = dhcp6_remove(link, /* only_marked= */ true); + r = dhcp6_remove(link, /* only_marked = */ true); if (r < 0) return r; } else @@ -381,7 +381,7 @@ static int dhcp6_lease_lost(Link *link) { link->dhcp6_lease = sd_dhcp6_lease_unref(link->dhcp6_lease); - r = dhcp6_remove(link, /* only_marked= */ false); + r = dhcp6_remove(link, /* only_marked = */ false); if (r < 0) return r; @@ -808,7 +808,7 @@ static int dhcp6_process_request(Request *req, Link *link, void *userdata) { assert(link); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return 0; r = dhcp_configure_duid(link, link_get_dhcp6_duid(link)); @@ -865,7 +865,7 @@ int link_drop_dhcp6_config(Link *link, Network *network) { ret = sd_dhcp6_client_stop(link->dhcp6_client); /* Also explicitly drop DHCPv6 addresses and routes. See also link_drop_dhcp4_config(). */ - RET_GATHER(ret, dhcp6_remove(link, /* only_marked= */ false)); + RET_GATHER(ret, dhcp6_remove(link, /* only_marked = */ false)); } /* Even if the client is currently enabled and also enabled in the new .network file, detailed diff --git a/src/network/networkd-ipv4acd.c b/src/network/networkd-ipv4acd.c index 5e6090231ae..8a0e5b85d08 100644 --- a/src/network/networkd-ipv4acd.c +++ b/src/network/networkd-ipv4acd.c @@ -162,7 +162,7 @@ static void on_acd(sd_ipv4acd *acd, int event, void *userdata) { switch (event) { case SD_IPV4ACD_EVENT_STOP: if (address->source == NETWORK_CONFIG_SOURCE_STATIC) { - r = static_ipv4acd_address_remove(link, address, /* on_conflict= */ false); + r = static_ipv4acd_address_remove(link, address, /* on_conflict = */ false); if (r < 0) link_enter_failed(link); } @@ -179,7 +179,7 @@ static void on_acd(sd_ipv4acd *acd, int event, void *userdata) { log_link_warning(link, "Dropping address %s, as an address conflict was detected.", IN4_ADDR_TO_STRING(&address->in_addr.in)); if (address->source == NETWORK_CONFIG_SOURCE_STATIC) - r = static_ipv4acd_address_remove(link, address, /* on_conflict= */ true); + r = static_ipv4acd_address_remove(link, address, /* on_conflict = */ true); else r = dhcp4_address_on_conflict(link); if (r < 0) @@ -215,7 +215,7 @@ static int ipv4acd_start_one(Link *link, sd_ipv4acd *acd) { if (!link_has_carrier(link)) return 0; - return sd_ipv4acd_start(acd, /* reset_conflicts= */ true); + return sd_ipv4acd_start(acd, /* reset_conflicts = */ true); } int ipv4acd_configure(Link *link, const Address *address) { diff --git a/src/network/networkd-json.c b/src/network/networkd-json.c index cd09ed29c97..cbb4255b9a5 100644 --- a/src/network/networkd-json.c +++ b/src/network/networkd-json.c @@ -242,7 +242,7 @@ int nexthops_append_json(Manager *manager, int ifindex, sd_json_variant **v) { log_nexthop_debug(nexthop, "Serializing", manager); } - r = nexthop_append_json(nexthop, /* serializing= */ ifindex < 0, &array); + r = nexthop_append_json(nexthop, /* serializing = */ ifindex < 0, &array); if (r < 0) return r; } @@ -299,7 +299,7 @@ static int route_append_json(Route *route, bool serializing, sd_json_variant **a if (r < 0) return r; - r = manager_get_route_table_to_string(route->manager, route->table, /* append_num= */ false, &table); + r = manager_get_route_table_to_string(route->manager, route->table, /* append_num = */ false, &table); if (r < 0) return r; @@ -352,7 +352,7 @@ int routes_append_json(Manager *manager, int ifindex, sd_json_variant **v) { log_route_debug(route, "Serializing", manager); } - r = route_append_json(route, /* serializing= */ ifindex < 0, &array); + r = route_append_json(route, /* serializing = */ ifindex < 0, &array); if (r < 0) return r; } @@ -368,7 +368,7 @@ static int routing_policy_rule_append_json(RoutingPolicyRule *rule, sd_json_vari assert(rule->manager); assert(array); - r = manager_get_route_table_to_string(rule->manager, rule->table, /* append_num= */ false, &table); + r = manager_get_route_table_to_string(rule->manager, rule->table, /* append_num = */ false, &table); if (r < 0 && r != -EINVAL) return r; @@ -1549,11 +1549,11 @@ int link_build_json(Link *link, sd_json_variant **ret) { if (r < 0) return r; - r = domains_append_json(link, /* is_route= */ false, &v); + r = domains_append_json(link, /* is_route = */ false, &v); if (r < 0) return r; - r = domains_append_json(link, /* is_route= */ true, &v); + r = domains_append_json(link, /* is_route = */ true, &v); if (r < 0) return r; @@ -1573,7 +1573,7 @@ int link_build_json(Link *link, sd_json_variant **ret) { if (r < 0) return r; - r = addresses_append_json(link, /* serializing= */ false, &v); + r = addresses_append_json(link, /* serializing = */ false, &v); if (r < 0) return r; @@ -1648,11 +1648,11 @@ int manager_build_json(Manager *manager, sd_json_variant **ret) { if (r < 0) return r; - r = nexthops_append_json(manager, /* ifindex= */ 0, &v); + r = nexthops_append_json(manager, /* ifindex = */ 0, &v); if (r < 0) return r; - r = routes_append_json(manager, /* ifindex= */ 0, &v); + r = routes_append_json(manager, /* ifindex = */ 0, &v); if (r < 0) return r; diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c index 1b96fbdbd39..91ad555f6c8 100644 --- a/src/network/networkd-link-bus.c +++ b/src/network/networkd-link-bus.c @@ -117,7 +117,7 @@ int bus_link_method_set_ntp_servers(sd_bus_message *message, void *userdata, sd_ strv_free_and_replace(l->ntp, ntp); - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -160,7 +160,7 @@ static int bus_link_method_set_dns_servers_internal(sd_bus_message *message, voi free_and_replace(l->dns, dns); l->n_dns = n; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -257,7 +257,7 @@ int bus_link_method_set_domains(sd_bus_message *message, void *userdata, sd_bus_ l->search_domains = TAKE_PTR(search_domains); l->route_domains = TAKE_PTR(route_domains); - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -292,7 +292,7 @@ int bus_link_method_set_default_route(sd_bus_message *message, void *userdata, s if (l->dns_default_route != b) { l->dns_default_route = b; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; } @@ -338,7 +338,7 @@ int bus_link_method_set_llmnr(sd_bus_message *message, void *userdata, sd_bus_er if (l->llmnr != mode) { l->llmnr = mode; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; } @@ -384,7 +384,7 @@ int bus_link_method_set_mdns(sd_bus_message *message, void *userdata, sd_bus_err if (l->mdns != mode) { l->mdns = mode; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; } @@ -430,7 +430,7 @@ int bus_link_method_set_dns_over_tls(sd_bus_message *message, void *userdata, sd if (l->dns_over_tls_mode != mode) { l->dns_over_tls_mode = mode; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; } @@ -476,7 +476,7 @@ int bus_link_method_set_dnssec(sd_bus_message *message, void *userdata, sd_bus_e if (l->dnssec_mode != mode) { l->dnssec_mode = mode; - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; } @@ -533,7 +533,7 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v set_free_and_replace(l->dnssec_negative_trust_anchors, ns); - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -562,7 +562,7 @@ int bus_link_method_revert_ntp(sd_bus_message *message, void *userdata, sd_bus_e link_ntp_settings_clear(l); - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -592,7 +592,7 @@ int bus_link_method_revert_dns(sd_bus_message *message, void *userdata, sd_bus_e link_dns_settings_clear(l); - r = link_save_and_clean_full(l, /* also_save_manager= */ true); + r = link_save_and_clean_full(l, /* also_save_manager = */ true); if (r < 0) return r; @@ -672,7 +672,7 @@ int bus_link_method_reconfigure(sd_bus_message *message, void *userdata, sd_bus_ if (r == 0) return 1; /* Polkit will call us back */ - r = link_reconfigure_full(l, LINK_RECONFIGURE_UNCONDITIONALLY | LINK_RECONFIGURE_CLEANLY, message, /* counter= */ NULL); + r = link_reconfigure_full(l, LINK_RECONFIGURE_UNCONDITIONALLY | LINK_RECONFIGURE_CLEANLY, message, /* counter = */ NULL); if (r != 0) return r; /* Will reply later when r > 0. */ diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 4a4b970ef24..458ddff27f8 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -412,7 +412,7 @@ int link_stop_engines(Link *link, bool may_keep_dynamic) { if (r < 0) RET_GATHER(ret, log_link_warning_errno(link, r, "Could not stop DHCPv6 client: %m")); - r = dhcp_pd_remove(link, /* only_marked= */ false); + r = dhcp_pd_remove(link, /* only_marked = */ false); if (r < 0) RET_GATHER(ret, log_link_warning_errno(link, r, "Could not remove DHCPv6 PD addresses and routes: %m")); @@ -466,7 +466,7 @@ void link_enter_failed(Link *link) { return; stop: - (void) link_stop_engines(link, /* may_keep_dynamic= */ false); + (void) link_stop_engines(link, /* may_keep_dynamic = */ false); } void link_check_ready(Link *link) { @@ -577,7 +577,7 @@ void link_check_ready(Link *link) { link_check_addresses_ready(link, NETWORK_CONFIG_SOURCE_NDISC)); /* If the uplink for PD is self, then request the corresponding DHCP protocol is also ready. */ - if (dhcp_pd_is_uplink(link, link, /* accept_auto= */ false)) { + if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) { if (link_dhcp4_enabled(link) && link->network->dhcp_use_6rd && sd_dhcp_lease_has_6rd(link->dhcp_lease)) { if (!link->dhcp4_configured) @@ -832,9 +832,9 @@ int link_handle_bound_to_list(Link *link) { } if (!required_up && link_is_up) - return link_request_to_bring_up_or_down(link, /* up= */ false); + return link_request_to_bring_up_or_down(link, /* up = */ false); if (required_up && !link_is_up) - return link_request_to_bring_up_or_down(link, /* up= */ true); + return link_request_to_bring_up_or_down(link, /* up = */ true); return 0; } @@ -1213,7 +1213,7 @@ static int link_configure(Link *link) { if (r < 0) return r; - r = link_request_to_set_mac(link, /* allow_retry= */ true); + r = link_request_to_set_mac(link, /* allow_retry = */ true); if (r < 0) return r; @@ -1364,7 +1364,7 @@ static void link_enter_unmanaged(Link *link) { log_link_full(link, link->state == LINK_STATE_INITIALIZED ? LOG_DEBUG : LOG_INFO, "Unmanaging interface."); - (void) link_stop_engines(link, /* may_keep_dynamic= */ false); + (void) link_stop_engines(link, /* may_keep_dynamic = */ false); (void) link_drop_requests(link); (void) link_drop_static_config(link); @@ -1479,7 +1479,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_dynamic= */ false); + r = link_stop_engines(link, /* may_keep_dynamic = */ false); if (r < 0) return r; @@ -1637,7 +1637,7 @@ static int link_initialized_and_synced(Link *link) { return r; } - return link_reconfigure_impl(link, /* flags= */ 0); + return link_reconfigure_impl(link, /* flags = */ 0); } static int link_initialized_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { @@ -1685,7 +1685,7 @@ static int link_initialized(Link *link, sd_device *device) { log_link_warning_errno(link, r, "Failed to manage SR-IOV PF and VF ports, ignoring: %m"); if (link->state != LINK_STATE_PENDING) - return link_reconfigure(link, /* flags= */ 0); + return link_reconfigure(link, /* flags = */ 0); log_link_debug(link, "udev initialized link"); @@ -1861,7 +1861,7 @@ static int link_carrier_lost_impl(Link *link) { if (!link->network) return ret; - RET_GATHER(ret, link_stop_engines(link, /* may_keep_dynamic= */ false)); + RET_GATHER(ret, link_stop_engines(link, /* may_keep_dynamic = */ false)); RET_GATHER(ret, link_drop_static_config(link)); return ret; @@ -1948,7 +1948,7 @@ static int link_admin_state_up(Link *link) { if (link->activated && link->network->activation_policy == ACTIVATION_POLICY_ALWAYS_DOWN) { log_link_info(link, "Activation policy is \"always-down\", forcing link down."); - return link_request_to_bring_up_or_down(link, /* up= */ false); + return link_request_to_bring_up_or_down(link, /* up = */ false); } /* We set the ipv6 mtu after the device mtu, but the kernel resets @@ -1971,7 +1971,7 @@ static int link_admin_state_down(Link *link) { if (link->activated && link->network->activation_policy == ACTIVATION_POLICY_ALWAYS_UP) { log_link_info(link, "Activation policy is \"always-up\", forcing link up."); - return link_request_to_bring_up_or_down(link, /* up= */ true); + return link_request_to_bring_up_or_down(link, /* up = */ true); } return 0; @@ -2936,7 +2936,7 @@ int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Man if (manager->enumerating) return 0; - r = link_reconfigure_impl(link, /* flags= */ 0); + r = link_reconfigure_impl(link, /* flags = */ 0); if (r < 0) { log_link_warning_errno(link, r, "Failed to reconfigure interface: %m"); link_enter_failed(link); diff --git a/src/network/networkd-manager-varlink.c b/src/network/networkd-manager-varlink.c index a0a7a5b5f5b..a83665b982d 100644 --- a/src/network/networkd-manager-varlink.c +++ b/src/network/networkd-manager-varlink.c @@ -29,7 +29,7 @@ static int vl_method_describe(sd_varlink *link, sd_json_variant *parameters, sd_ assert(parameters); assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -46,7 +46,7 @@ static int vl_method_get_states(sd_varlink *link, sd_json_variant *parameters, s assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -67,7 +67,7 @@ static int vl_method_get_namespace_id(sd_varlink *link, sd_json_variant *paramet assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index e3c794b82b8..fc0a4355541 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -216,7 +216,7 @@ static int manager_listen_fds(Manager *m, int *ret_rtnl_fd, int *ret_varlink_fd, assert(ret_varlink_fd); assert(ret_resolve_hook_fd); - n = sd_listen_fds_with_names(/* unset_environment= */ true, &names); + n = sd_listen_fds_with_names(/* unset_environment = */ true, &names); if (n < 0) return n; @@ -504,7 +504,7 @@ static int manager_stop(Manager *manager, ManagerState state) { Link *link; HASHMAP_FOREACH(link, manager->links_by_index) - (void) link_stop_engines(link, /* may_keep_dynamic= */ true); + (void) link_stop_engines(link, /* may_keep_dynamic = */ true); return 0; } @@ -520,7 +520,7 @@ static int signal_restart_callback(sd_event_source *s, const struct signalfd_sig static int signal_reload_callback(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { Manager *m = ASSERT_PTR(userdata); - (void) manager_reload(m, /* message= */ NULL); + (void) manager_reload(m, /* message = */ NULL); return 0; } @@ -1258,8 +1258,8 @@ int manager_reload(Manager *m, sd_bus_message *message) { } HASHMAP_FOREACH(link, m->links_by_index) - (void) link_reconfigure_full(link, /* flags= */ 0, message, - /* counter= */ message ? &m->reloading : NULL); + (void) link_reconfigure_full(link, /* flags = */ 0, message, + /* counter = */ message ? &m->reloading : NULL); log_debug("Reloaded."); r = 0; diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 93965f52536..6c6f823c0c7 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -501,7 +501,7 @@ static int ndisc_request_route(Route *route, Link *link) { if (r < 0) return r; - r = ndisc_set_route_nexthop(route, link, /* request= */ true); + r = ndisc_set_route_nexthop(route, link, /* request = */ true); if (r < 0) return r; @@ -623,7 +623,7 @@ static int ndisc_remove_route(Route *route, Link *link) { assert(link); assert(link->manager); - r = ndisc_set_route_nexthop(route, link, /* request= */ false); + r = ndisc_set_route_nexthop(route, link, /* request = */ false); if (r < 0) return r; @@ -979,7 +979,7 @@ static int ndisc_redirect_handler(Link *link, sd_ndisc_redirect *rd) { if (r < 0) return r; - r = ndisc_drop_outdated(link, /* router= */ NULL, now_usec); + r = ndisc_drop_outdated(link, /* router = */ NULL, now_usec); if (r < 0) return r; @@ -2522,7 +2522,7 @@ static int ndisc_expire_handler(sd_event_source *s, uint64_t usec, void *userdat assert_se(sd_event_now(link->manager->event, CLOCK_BOOTTIME, &now_usec) >= 0); - (void) ndisc_drop_outdated(link, /* router= */ NULL, now_usec); + (void) ndisc_drop_outdated(link, /* router = */ NULL, now_usec); (void) ndisc_setup_expire(link); return 0; } @@ -2629,7 +2629,7 @@ static int ndisc_start_dhcp6_client(Link *link, sd_ndisc_router *rt) { case IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS: /* When IPv6AcceptRA.DHCPv6Client=always, start dhcp6 client in solicit mode * even if the router flags have neither M nor O flags. */ - r = dhcp6_start_on_ra(link, /* information_request= */ false); + r = dhcp6_start_on_ra(link, /* information_request = */ false); break; default: @@ -2677,7 +2677,7 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) { if (r < 0) return r; - r = ndisc_drop_outdated(link, /* router= */ NULL, timestamp_usec); + r = ndisc_drop_outdated(link, /* router = */ NULL, timestamp_usec); if (r < 0) return r; @@ -2705,7 +2705,7 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) { if (r < 0) return r; - r = ndisc_router_process_options(link, rt, /* zero_lifetime= */ true); + r = ndisc_router_process_options(link, rt, /* zero_lifetime = */ true); if (r < 0) return r; @@ -2713,7 +2713,7 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) { if (r < 0) return r; - r = ndisc_router_process_options(link, rt, /* zero_lifetime= */ false); + r = ndisc_router_process_options(link, rt, /* zero_lifetime = */ false); if (r < 0) return r; @@ -2999,7 +2999,7 @@ static int ndisc_process_request(Request *req, Link *link, void *userdata) { assert(link); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return 0; r = ndisc_configure(link); @@ -3074,7 +3074,7 @@ int link_drop_ndisc_config(Link *link, Network *network) { /* Redirect messages will be ignored. Drop configurations based on the previously received redirect * messages. */ if (!network->ndisc_use_redirect) - (void) ndisc_drop_redirect(link, /* router= */ NULL); + (void) ndisc_drop_redirect(link, /* router = */ NULL); /* If one of the route setting is changed, drop all routes. */ if (link->network->ndisc_use_gateway != network->ndisc_use_gateway || @@ -3143,8 +3143,8 @@ void ndisc_flush(Link *link) { assert(link); /* Remove all addresses, routes, RDNSS, DNSSL, DNR, and Captive Portal entries, without exception. */ - (void) ndisc_drop_outdated(link, /* router= */ NULL, /* timestamp_usec= */ USEC_INFINITY); - (void) ndisc_drop_redirect(link, /* router= */ NULL); + (void) ndisc_drop_outdated(link, /* router = */ NULL, /* timestamp_usec = */ USEC_INFINITY); + (void) ndisc_drop_redirect(link, /* router = */ NULL); link->ndisc_routers_by_sender = hashmap_free(link->ndisc_routers_by_sender); link->ndisc_rdnss = set_free(link->ndisc_rdnss); diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index e4a44666b48..3bcd0e1324c 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -497,7 +497,7 @@ int link_drop_unmanaged_neighbors(Link *link) { if (!neighbor_exists(neighbor)) continue; - if (!link_should_mark_config(link, /* only_static= */ false, neighbor->source, RTPROT_STATIC)) + if (!link_should_mark_config(link, /* only_static = */ false, neighbor->source, RTPROT_STATIC)) continue; neighbor_mark(neighbor); diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 14c51a8e64e..e1ecc15235c 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -515,7 +515,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi }; r = config_parse_many( - STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root= */ NULL, + STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, /* root = */ NULL, "Match\0" "Link\0" "SR-IOV\0" @@ -600,7 +600,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi return log_warning_errno(r, "%s: Failed to store configuration into hashmap: %m", filename); TAKE_PTR(network); - log_syntax(/* unit= */ NULL, LOG_DEBUG, filename, /* config_line= */ 0, /* error= */ 0, "Successfully loaded."); + log_syntax(/* unit = */ NULL, LOG_DEBUG, filename, /* config_line = */ 0, /* error = */ 0, "Successfully loaded."); return 0; } diff --git a/src/network/networkd-nexthop.h b/src/network/networkd-nexthop.h index a6c080c83b6..3eee6680b26 100644 --- a/src/network/networkd-nexthop.h +++ b/src/network/networkd-nexthop.h @@ -59,10 +59,10 @@ int network_drop_invalid_nexthops(Network *network); int link_drop_nexthops(Link *link, bool only_static); static inline int link_drop_unmanaged_nexthops(Link *link) { - return link_drop_nexthops(link, /* only_static= */ false); + return link_drop_nexthops(link, /* only_static = */ false); } static inline int link_drop_static_nexthops(Link *link) { - return link_drop_nexthops(link, /* only_static= */ true); + return link_drop_nexthops(link, /* only_static = */ true); } void link_forget_nexthops(Link *link); diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index 0ef292bdf22..bf5b9216b05 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -378,7 +378,7 @@ static int radv_set_dns(Link *link, Link *uplink) { n_dns, dns, link->network->router_dns_lifetime_usec, - /* valid_until= */ USEC_INFINITY); + /* valid_until = */ USEC_INFINITY); } static int radv_set_domains(Link *link, Link *uplink) { @@ -416,7 +416,7 @@ static int radv_set_domains(Link *link, Link *uplink) { link->radv, s, link->network->router_dns_lifetime_usec, - /* valid_until= */ USEC_INFINITY); + /* valid_until = */ USEC_INFINITY); } static int radv_find_uplink(Link *link, Link **ret) { @@ -556,7 +556,7 @@ static int radv_configure(Link *link) { link->radv, link->network->router_home_agent_preference, link->network->home_agent_lifetime_usec, - /* valid_until= */ USEC_INFINITY); + /* valid_until = */ USEC_INFINITY); if (r < 0) return r; } @@ -583,7 +583,7 @@ static int radv_is_ready_to_configure(Link *link) { assert(link); assert(link->network); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return false; if (in6_addr_is_null(&link->ipv6ll_address)) diff --git a/src/network/networkd-route-metric.c b/src/network/networkd-route-metric.c index 0c4c35a9bba..89222a23701 100644 --- a/src/network/networkd-route-metric.c +++ b/src/network/networkd-route-metric.c @@ -131,7 +131,7 @@ static void route_metric_unset(RouteMetric *metric, uint16_t attr) { if (metric->n_metrics_set > attr) metric->metrics_set[attr] = false; - assert_se(route_metric_set_full(metric, attr, 0, /* force= */ false) >= 0); + assert_se(route_metric_set_full(metric, attr, 0, /* force = */ false) >= 0); } uint32_t route_metric_get(const RouteMetric *metric, uint16_t attr) { @@ -412,7 +412,7 @@ int config_parse_route_metric( &route->metric, ltype, k, - /* force= */ true) < 0) + /* force = */ true) < 0) return log_oom(); return 1; diff --git a/src/network/networkd-route-nexthop.c b/src/network/networkd-route-nexthop.c index 9f5970270e0..5ad8cd4c648 100644 --- a/src/network/networkd-route-nexthop.c +++ b/src/network/networkd-route-nexthop.c @@ -142,11 +142,11 @@ static int route_nexthop_compare_func_full(const RouteNextHop *a, const RouteNex } static void route_nexthop_hash_func(const RouteNextHop *nh, struct siphash *state) { - route_nexthop_hash_func_full(nh, state, /* with_weight= */ true); + route_nexthop_hash_func_full(nh, state, /* with_weight = */ true); } static int route_nexthop_compare_func(const RouteNextHop *a, const RouteNextHop *b) { - return route_nexthop_compare_func_full(a, b, /* with_weight= */ true); + return route_nexthop_compare_func_full(a, b, /* with_weight = */ true); } DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR( @@ -178,7 +178,7 @@ void route_nexthops_hash_func(const Route *route, struct siphash *state) { return; case 1: - route_nexthop_hash_func_full(&route->nexthop, state, /* with_weight= */ false); + route_nexthop_hash_func_full(&route->nexthop, state, /* with_weight = */ false); return; default: { @@ -205,7 +205,7 @@ int route_nexthops_compare_func(const Route *a, const Route *b) { return CMP(a->nexthop_id, b->nexthop_id); case 1: - return route_nexthop_compare_func_full(&a->nexthop, &b->nexthop, /* with_weight= */ false); + return route_nexthop_compare_func_full(&a->nexthop, &b->nexthop, /* with_weight = */ false); default: { RouteNextHop *nh; @@ -414,7 +414,7 @@ static bool route_nexthop_is_ready_to_configure(const RouteNextHop *nh, Manager if (route_nexthop_get_link(manager, nh, &link) < 0) return false; - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ true)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ true)) return false; /* If the interface is not managed by us, we request that the interface has carrier. diff --git a/src/network/networkd-route-util.c b/src/network/networkd-route-util.c index 37ace2d335c..ee5b900d067 100644 --- a/src/network/networkd-route-util.c +++ b/src/network/networkd-route-util.c @@ -29,12 +29,12 @@ unsigned routes_max(void) { /* The kernel internally stores these maximum size in int. */ - if (sysctl_read_ip_property_int(AF_INET, /* ifname= */ NULL, "route/max_size", &val4) >= 0) + if (sysctl_read_ip_property_int(AF_INET, /* ifname = */ NULL, "route/max_size", &val4) >= 0) if (val4 == INT_MAX) /* This is the default "no limit" value in the kernel */ val4 = ROUTES_DEFAULT_MAX_PER_FAMILY; - if (sysctl_read_ip_property_int(AF_INET6, /* ifname= */ NULL, "route/max_size", &val6) >= 0) + if (sysctl_read_ip_property_int(AF_INET6, /* ifname = */ NULL, "route/max_size", &val6) >= 0) if (val6 == INT_MAX) /* This is the default "no limit" value in the kernel */ val6 = ROUTES_DEFAULT_MAX_PER_FAMILY; diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 950bddc5e6f..94b87d21799 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -444,7 +444,7 @@ static int route_to_string(const Route *route, Manager *manager, char **ret) { if (in_addr_is_set(route->family, &route->prefsrc)) (void) in_addr_to_string(route->family, &route->prefsrc, &prefsrc); (void) route_scope_to_string_alloc(route->scope, &scope); - (void) manager_get_route_table_to_string(manager, route->table, /* append_num= */ true, &table); + (void) manager_get_route_table_to_string(manager, route->table, /* append_num = */ true, &table); (void) route_protocol_full_to_string_alloc(route->protocol, &proto); (void) route_flags_to_string_alloc(route->flags, &flags); @@ -906,7 +906,7 @@ static int route_is_ready_to_configure(const Route *route, Link *link) { assert(route); assert(link); - if (!link_is_ready_to_configure(link, /* allow_unmanaged= */ false)) + if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false)) return false; if (in_addr_is_set(route->family, &route->prefsrc) > 0) { diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index eb60d315bd2..9ad12fb855a 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -331,7 +331,7 @@ static int routing_policy_rule_compare_func_full(const RoutingPolicyRule *a, con } static int routing_policy_rule_compare_func(const RoutingPolicyRule *a, const RoutingPolicyRule *b) { - return routing_policy_rule_compare_func_full(a, b, /* all= */ true); + return routing_policy_rule_compare_func_full(a, b, /* all = */ true); } static bool routing_policy_rule_equal(const RoutingPolicyRule *a, const RoutingPolicyRule *b, int family, uint32_t priority) { @@ -348,7 +348,7 @@ static bool routing_policy_rule_equal(const RoutingPolicyRule *a, const RoutingP if (b->priority_set && b->priority != priority) return false; - return routing_policy_rule_compare_func_full(a, b, /* all= */ false) == 0; + return routing_policy_rule_compare_func_full(a, b, /* all = */ false) == 0; } static bool routing_policy_rule_can_update(const RoutingPolicyRule *existing, const RoutingPolicyRule *requesting) { @@ -538,7 +538,7 @@ static void log_routing_policy_rule_debug(const RoutingPolicyRule *rule, const c return; (void) network_config_state_to_string_alloc(rule->state, &state); - (void) manager_get_route_table_to_string(m, rule->table, /* append_num= */ true, &table); + (void) manager_get_route_table_to_string(m, rule->table, /* append_num = */ true, &table); log_link_debug(link, "%s %s routing policy rule (%s): priority: %"PRIu32", %s -> %s, iif: %s, oif: %s, table: %s", @@ -878,10 +878,10 @@ static int routing_policy_rule_is_ready_to_configure(const RoutingPolicyRule *ru * shows [detached] for such rules, that may confuse users. Let's postpone to configure if one of * IIF/OIF does not exist. */ - if (rule->iif && !link_is_ready_to_configure_by_name(link->manager, rule->iif, /* allow_unmanaged= */ true)) + if (rule->iif && !link_is_ready_to_configure_by_name(link->manager, rule->iif, /* allow_unmanaged = */ true)) return false; - if (rule->oif && !link_is_ready_to_configure_by_name(link->manager, rule->oif, /* allow_unmanaged= */ true)) + if (rule->oif && !link_is_ready_to_configure_by_name(link->manager, rule->oif, /* allow_unmanaged = */ true)) return false; return true; @@ -1464,7 +1464,7 @@ static int config_parse_routing_policy_rule_port_range( assert(rvalue); - r = parse_ip_port_range(rvalue, &p->start, &p->end, /* allow_zero= */ false); + r = parse_ip_port_range(rvalue, &p->start, &p->end, /* allow_zero = */ false); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse routing policy rule port range '%s'", rvalue); return 0; diff --git a/src/network/networkd-serialize.c b/src/network/networkd-serialize.c index 31f885d87a3..8fd978bf098 100644 --- a/src/network/networkd-serialize.c +++ b/src/network/networkd-serialize.c @@ -41,7 +41,7 @@ int manager_serialize(Manager *manager) { if (r < 0) return r; - r = addresses_append_json(link, /* serializing= */ true, &e); + r = addresses_append_json(link, /* serializing = */ true, &e); if (r < 0) return r; @@ -54,11 +54,11 @@ int manager_serialize(Manager *manager) { if (r < 0) return r; - r = nexthops_append_json(manager, /* ifindex= */ -1, &v); + r = nexthops_append_json(manager, /* ifindex = */ -1, &v); if (r < 0) return r; - r = routes_append_json(manager, /* ifindex= */ -1, &v); + r = routes_append_json(manager, /* ifindex = */ -1, &v); if (r < 0) return r; @@ -69,7 +69,7 @@ int manager_serialize(Manager *manager) { } _cleanup_free_ char *dump = NULL; - r = sd_json_variant_format(v, /* flags= */ 0, &dump); + r = sd_json_variant_format(v, /* flags = */ 0, &dump); if (r < 0) return r; @@ -450,8 +450,8 @@ int manager_deserialize(Manager *manager) { unsigned err_line = 0, err_column = 0; r = sd_json_parse_file( f, - /* path= */ NULL, - /* flags= */ 0, + /* path = */ NULL, + /* flags = */ 0, &v, &err_line, &err_column); diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index c4abb777631..ed51ecdd797 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -88,7 +88,7 @@ static int set_link_handler_internal( static int link_set_addrgen_mode_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { int r; - r = set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, NULL); + r = set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); if (r <= 0) return r; @@ -102,11 +102,11 @@ static int link_set_addrgen_mode_handler(sd_netlink *rtnl, sd_netlink_message *m } static int link_set_bond_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); } static int link_set_bridge_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); } static int link_set_bridge_vlan_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { @@ -114,7 +114,7 @@ static int link_set_bridge_vlan_handler(sd_netlink *rtnl, sd_netlink_message *m, assert(link); - r = set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, NULL); + r = set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); if (r <= 0) return r; @@ -123,27 +123,27 @@ static int link_set_bridge_vlan_handler(sd_netlink *rtnl, sd_netlink_message *m, } static int link_del_bridge_vlan_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); } static int link_set_can_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); } static int link_set_flags_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, get_link_default_handler); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, get_link_default_handler); } static int link_set_group_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, NULL); } static int link_set_ipoib_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, NULL); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, NULL); } static int link_set_mac_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, get_link_default_handler); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_default_handler); } static int link_set_mac_allow_retry_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { @@ -160,7 +160,7 @@ static int link_set_mac_allow_retry_handler(sd_netlink *rtnl, sd_netlink_message log_link_message_debug_errno(link, m, r, "Failed to set MAC address, retrying again"); - r = link_request_to_set_mac(link, /* allow_retry= */ false); + r = link_request_to_set_mac(link, /* allow_retry = */ false); if (r < 0) link_enter_failed(link); @@ -171,16 +171,16 @@ static int link_set_mac_allow_retry_handler(sd_netlink *rtnl, sd_netlink_message } static int link_set_master_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ false, get_link_master_handler); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ false, get_link_master_handler); } static int link_unset_master_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { /* Some devices do not support setting master ifindex. Let's ignore error on unsetting master ifindex. */ - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, get_link_master_handler); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_master_handler); } static int link_set_mtu_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, void *userdata) { - return set_link_handler_internal(rtnl, m, req, link, /* ignore= */ true, get_link_default_handler); + return set_link_handler_internal(rtnl, m, req, link, /* ignore = */ true, get_link_default_handler); } static int link_get_arp(Link *link) { @@ -372,12 +372,12 @@ static int link_configure_fill_message( return r; break; case REQUEST_TYPE_SET_LINK_BRIDGE_VLAN: - r = bridge_vlan_set_message(link, req, /* is_set= */ true); + r = bridge_vlan_set_message(link, req, /* is_set = */ true); if (r < 0) return r; break; case REQUEST_TYPE_DEL_LINK_BRIDGE_VLAN: - r = bridge_vlan_set_message(link, req, /* is_set= */ false); + r = bridge_vlan_set_message(link, req, /* is_set = */ false); if (r < 0) return r; break; @@ -908,7 +908,7 @@ int link_request_to_set_mac(Link *link, bool allow_retry) { return 0; link->requested_hw_addr = link->network->hw_addr; - r = net_verify_hardware_address(link->ifname, /* is_static= */ true, + r = net_verify_hardware_address(link->ifname, /* is_static = */ true, link->iftype, &link->hw_addr, &link->requested_hw_addr); if (r < 0) return r; @@ -1049,12 +1049,12 @@ static int link_up_dsa_slave(Link *link) { if (master->state == LINK_STATE_UNMANAGED) { /* If the DSA master interface is unmanaged, then it will never become up. * Let's request to bring up the master. */ - r = link_request_to_bring_up_or_down(master, /* up= */ true); + r = link_request_to_bring_up_or_down(master, /* up = */ true); if (r < 0) return r; } - r = link_request_to_bring_up_or_down(link, /* up= */ true); + r = link_request_to_bring_up_or_down(link, /* up = */ true); if (r < 0) return r; @@ -1140,7 +1140,7 @@ static bool link_is_ready_to_activate_one(Link *link, bool allow_unmanaged) { static bool link_is_ready_to_activate(Link *link, bool up) { assert(link); - if (!check_ready_for_all_sr_iov_ports(link, /* allow_unmanaged= */ false, + if (!check_ready_for_all_sr_iov_ports(link, /* allow_unmanaged = */ false, link_is_ready_to_activate_one)) return false; @@ -1305,11 +1305,11 @@ static int link_up_or_down_now_handler(sd_netlink *rtnl, sd_netlink_message *m, } static int link_up_now_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { - return link_up_or_down_now_handler(rtnl, m, link, /* up= */ true); + return link_up_or_down_now_handler(rtnl, m, link, /* up = */ true); } static int link_down_now_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { - return link_up_or_down_now_handler(rtnl, m, link, /* up= */ false); + return link_up_or_down_now_handler(rtnl, m, link, /* up = */ false); } int link_up_or_down_now(Link *link, bool up) { diff --git a/src/network/networkd-sriov.c b/src/network/networkd-sriov.c index f5591f5672d..c45e4487183 100644 --- a/src/network/networkd-sriov.c +++ b/src/network/networkd-sriov.c @@ -345,7 +345,7 @@ bool check_ready_for_all_sr_iov_ports( /* If this is a VF port, then also check the PF port. */ if (link->sr_iov_phys_port_ifindex > 0) { if (link_get_by_index(link->manager, link->sr_iov_phys_port_ifindex, &phys_link) < 0 || - !check_one(phys_link, /* allow_unmanaged= */ true)) + !check_one(phys_link, /* allow_unmanaged = */ true)) return false; } else phys_link = link; @@ -361,7 +361,7 @@ bool check_ready_for_all_sr_iov_ports( if (link_get_by_index(link->manager, ifindex, &virt_link) < 0) return false; - if (!check_one(virt_link, /* allow_unmanaged= */ true)) + if (!check_one(virt_link, /* allow_unmanaged = */ true)) return false; } diff --git a/src/network/networkd-state-file.c b/src/network/networkd-state-file.c index c57fc8462d6..5f904d59cd0 100644 --- a/src/network/networkd-state-file.c +++ b/src/network/networkd-state-file.c @@ -398,11 +398,11 @@ int manager_save(Manager *m) { if (r < 0) return r; - r = link_put_domains(link, /* is_route= */ false, &search_domains); + r = link_put_domains(link, /* is_route = */ false, &search_domains); if (r < 0) return r; - r = link_put_domains(link, /* is_route= */ true, &route_domains); + r = link_put_domains(link, /* is_route = */ true, &route_domains); if (r < 0) return r; } diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c index ab544604e29..c6ff7200386 100644 --- a/src/network/networkd-sysctl.c +++ b/src/network/networkd-sysctl.c @@ -531,7 +531,7 @@ int link_set_ipv6_mtu(Link *link, int log_level) { if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) return 0; - if (sd_event_source_get_enabled(link->ipv6_mtu_wait_synced_event_source, /* ret= */ NULL) > 0) { + if (sd_event_source_get_enabled(link->ipv6_mtu_wait_synced_event_source, /* ret = */ NULL) > 0) { log_link_debug(link, "Waiting for IPv6 MTU is synced to link MTU, delaying to set IPv6 MTU."); return 0; } @@ -598,7 +598,7 @@ static int link_set_ipv6_mtu_async_impl(Link *link) { link->manager->event, &link->ipv6_mtu_wait_synced_event_source, CLOCK_BOOTTIME, 100 * USEC_PER_MSEC, 0, ipv6_mtu_wait_synced_handler, link, - /* priority= */ 0, "ipv6-mtu-wait-synced", /* force_reset= */ true); + /* priority = */ 0, "ipv6-mtu-wait-synced", /* force_reset = */ true); if (r < 0) return log_link_warning_errno(link, r, "Failed to configure timer event source for waiting for IPv6 MTU being synced: %m"); diff --git a/src/network/networkd-wifi.c b/src/network/networkd-wifi.c index c288ae23e92..3caacef0892 100644 --- a/src/network/networkd-wifi.c +++ b/src/network/networkd-wifi.c @@ -290,7 +290,7 @@ int manager_genl_process_nl80211_mlme(sd_netlink *genl, sd_netlink_message *mess * To make SSID= or other WiFi related settings in [Match] section work, let's try to * reconfigure the interface. */ if (link->ssid && link_has_carrier(link)) { - r = link_reconfigure_impl(link, /* flags= */ 0); + r = link_reconfigure_impl(link, /* flags = */ 0); if (r < 0) { log_link_warning_errno(link, r, "Failed to reconfigure interface: %m"); link_enter_failed(link); @@ -329,7 +329,7 @@ int manager_genl_process_nl80211_mlme(sd_netlink *genl, sd_netlink_message *mess } /* If necessary, reconfigure based on those new properties */ - r = link_reconfigure_impl(link, /* flags= */ 0); + r = link_reconfigure_impl(link, /* flags = */ 0); if (r < 0) { log_link_warning_errno(link, r, "Failed to reconfigure interface: %m"); link_enter_failed(link); diff --git a/src/network/networkd.c b/src/network/networkd.c index 3e0666610bf..7e09629ddbe 100644 --- a/src/network/networkd.c +++ b/src/network/networkd.c @@ -79,7 +79,7 @@ static int run(int argc, char *argv[]) { log_warning_errno(r, "Could not create directory '%s': %m", p); } - r = manager_new(&m, /* test_mode= */ false); + r = manager_new(&m, /* test_mode = */ false); if (r < 0) return log_error_errno(r, "Could not create manager: %m"); diff --git a/src/network/tc/teql.c b/src/network/tc/teql.c index 1f73fb33e4a..c0d9d239650 100644 --- a/src/network/tc/teql.c +++ b/src/network/tc/teql.c @@ -32,7 +32,7 @@ static int trivial_link_equalizer_is_ready(QDisc *qdisc, Link *link) { if (link_get_by_name(link->manager, qdisc->tca_kind, &teql) < 0) return false; - return link_is_ready_to_configure(teql, /* allow_unmanaged= */ true); + return link_is_ready_to_configure(teql, /* allow_unmanaged = */ true); } const QDiscVTable teql_vtable = { diff --git a/src/network/test-network.c b/src/network/test-network.c index 253e0d660d6..89435c609ba 100644 --- a/src/network/test-network.c +++ b/src/network/test-network.c @@ -96,12 +96,12 @@ static void test_route_tables_one(Manager *manager, const char *name, uint32_t n } ASSERT_OK(asprintf(&expected, "%s(%" PRIu32 ")", name, number)); - ASSERT_OK(manager_get_route_table_to_string(manager, number, /* append_num= */ true, &str)); + ASSERT_OK(manager_get_route_table_to_string(manager, number, /* append_num = */ true, &str)); ASSERT_STREQ(str, expected); str = mfree(str); - ASSERT_OK(manager_get_route_table_to_string(manager, number, /* append_num= */ false, &str)); + ASSERT_OK(manager_get_route_table_to_string(manager, number, /* append_num = */ false, &str)); ASSERT_STREQ(str, name); ASSERT_OK(manager_get_route_table_from_string(manager, name, &t)); @@ -115,7 +115,7 @@ static void test_route_tables_one(Manager *manager, const char *name, uint32_t n TEST(route_tables) { _cleanup_(manager_freep) Manager *manager = NULL; - ASSERT_OK(manager_new(&manager, /* test_mode= */ true)); + ASSERT_OK(manager_new(&manager, /* test_mode = */ true)); ASSERT_OK(manager_setup(manager)); ASSERT_OK(config_parse_route_table_names("manager", "filename", 1, "section", 1, "RouteTable", 0, "hoge:123 foo:456 aaa:111", manager, manager)); @@ -153,7 +153,7 @@ TEST(route_tables) { TEST(manager_enumerate) { _cleanup_(manager_freep) Manager *manager = NULL; - ASSERT_OK(manager_new(&manager, /* test_mode= */ true)); + ASSERT_OK(manager_new(&manager, /* test_mode = */ true)); ASSERT_OK(manager_setup(manager)); /* TODO: should_reload, is false if the config dirs do not exist, so we can't do this test here, move diff --git a/src/network/test-networkd-conf.c b/src/network/test-networkd-conf.c index ddb8fcaa36a..e4533737bfc 100644 --- a/src/network/test-networkd-conf.c +++ b/src/network/test-networkd-conf.c @@ -186,7 +186,7 @@ static void test_config_parse_address_one(const char *rvalue, int family, unsign _cleanup_(manager_freep) Manager *manager = NULL; _cleanup_(network_unrefp) Network *network = NULL; - assert_se(manager_new(&manager, /* test_mode= */ true) >= 0); + assert_se(manager_new(&manager, /* test_mode = */ true) >= 0); assert_se(network = new0(Network, 1)); network->n_ref = 1; network->manager = manager; diff --git a/src/network/wait-online/wait-online-manager.c b/src/network/wait-online/wait-online-manager.c index b5ca38cbe24..2d014a3ec78 100644 --- a/src/network/wait-online/wait-online-manager.c +++ b/src/network/wait-online/wait-online-manager.c @@ -212,7 +212,7 @@ bool manager_configured(Manager *m) { continue; } - range = get_state_range(m, l, /* from_cmdline= */ NULL); + range = get_state_range(m, l, /* from_cmdline = */ NULL); r = manager_link_is_online(m, l, range); /* Unlike the above loop, unmanaged interfaces are ignored here. Also, Configured but offline diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c index 55ce8e1e062..db99b7d8463 100644 --- a/src/nspawn/nspawn-cgroup.c +++ b/src/nspawn/nspawn-cgroup.c @@ -113,7 +113,7 @@ int create_subcgroup( return log_error_errno(r, "Failed to add cgroup %s to userns: %m", payload); } else { _cleanup_free_ char *fs = NULL; - r = cg_get_path(payload, /* suffix= */ NULL, &fs); + r = cg_get_path(payload, /* suffix = */ NULL, &fs); if (r < 0) return log_error_errno(r, "Failed to get file system path for container cgroup: %m"); @@ -147,14 +147,14 @@ int mount_cgroups(const char *dest, bool accept_existing) { if (r < 0) return log_error_errno(r, "Failed to chase %s/sys/fs/cgroup: %m", strempty(dest)); - r = is_mount_point_at(fd, /* filename= */ NULL, /* flags= */ 0); + r = is_mount_point_at(fd, /* filename = */ NULL, /* flags = */ 0); if (r < 0) return log_error_errno(r, "Failed to determine if %s is mounted already: %m", p); if (r > 0) { if (!accept_existing) return log_error_errno(SYNTHETIC_ERRNO(EEXIST), "Refusing existing cgroupfs mount: %s", p); - if (faccessat(fd, "cgroup.procs", F_OK, /* flags= */ 0) >= 0) + if (faccessat(fd, "cgroup.procs", F_OK, /* flags = */ 0) >= 0) return 0; if (errno != ENOENT) return log_error_errno(errno, "Failed to determine if mount point %s contains the unified cgroup hierarchy: %m", p); diff --git a/src/nspawn/nspawn-expose-ports.c b/src/nspawn/nspawn-expose-ports.c index 776ac052c40..e312a90710c 100644 --- a/src/nspawn/nspawn-expose-ports.c +++ b/src/nspawn/nspawn-expose-ports.c @@ -93,13 +93,13 @@ int expose_port_flush(sd_netlink *nfnl, ExposePort* l, int af, union in_addr_uni LIST_FOREACH(ports, p, l) { r = fw_nftables_add_local_dnat( nfnl, - /* add= */ false, + /* add = */ false, af, p->protocol, p->host_port, exposed, p->container_port, - /* previous_remote= */ NULL); + /* previous_remote = */ NULL); if (r < 0) log_warning_errno(r, "Failed to modify %s firewall: %m", af_to_name(af)); } @@ -145,7 +145,7 @@ int expose_port_execute(sd_netlink *rtnl, sd_netlink *nfnl, ExposePort *l, int a LIST_FOREACH(ports, p, l) { r = fw_nftables_add_local_dnat( nfnl, - /* add= */ true, + /* add = */ true, af, p->protocol, p->host_port, diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index a996b28fce0..0617e28a5fd 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -1499,21 +1499,21 @@ int wipe_fully_visible_api_fs(int mntns_fd) { if (orig_mntns_fd < 0) return log_error_errno(orig_mntns_fd, "Failed to pin originating mount namespace: %m"); - r = namespace_enter(/* pidns_fd= */ -EBADF, + r = namespace_enter(/* pidns_fd = */ -EBADF, mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF); + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF); if (r < 0) return log_error_errno(r, "Failed to enter mount namespace: %m"); rr = do_wipe_fully_visible_api_fs(); - r = namespace_enter(/* pidns_fd= */ -EBADF, + r = namespace_enter(/* pidns_fd = */ -EBADF, orig_mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF); + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF); if (r < 0) return log_error_errno(r, "Failed to enter original mount namespace: %m"); diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c index f509e7d6728..50ffffdd3ca 100644 --- a/src/nspawn/nspawn-network.c +++ b/src/nspawn/nspawn-network.c @@ -478,15 +478,15 @@ static int netns_child_begin(int netns_fd, int *ret_original_netns_fd) { return log_error_errno(original_netns_fd, "Failed to open original network namespace: %m"); } - r = namespace_enter(/* pidns_fd= */ -EBADF, - /* mntns_fd= */ -EBADF, + r = namespace_enter(/* pidns_fd = */ -EBADF, + /* mntns_fd = */ -EBADF, netns_fd, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF); + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF); if (r < 0) return log_error_errno(r, "Failed to enter child network namespace: %m"); - r = umount_recursive("/sys/", /* flags= */ 0); + r = umount_recursive("/sys/", /* flags = */ 0); if (r < 0) log_debug_errno(r, "Failed to unmount directories below /sys/, ignoring: %m"); @@ -494,7 +494,7 @@ static int netns_child_begin(int netns_fd, int *ret_original_netns_fd) { /* Populate new sysfs instance associated with the client netns, to make sd_device usable. */ r = mount_nofollow_verbose(LOG_ERR, "sysfs", "/sys/", "sysfs", - MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV, /* options= */ NULL); + MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV, /* options = */ NULL); if (r < 0) return log_error_errno(r, "Failed to mount sysfs on /sys/: %m"); diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index e4fccaa3a78..9a896951e4b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2235,14 +2235,14 @@ static int copy_devnodes(const char *dest) { /* Required basic device nodes. */ FOREACH_STRING(node, "null", "zero", "full", "random", "urandom", "tty") { - r = copy_devnode_one(dest, node, /* check= */ false); + r = copy_devnode_one(dest, node, /* check = */ false); if (r < 0) return r; } /* Optional device nodes. */ FOREACH_STRING(node, "fuse", "net/tun") { - r = copy_devnode_one(dest, node, /* check= */ true); + r = copy_devnode_one(dest, node, /* check = */ true); if (r < 0) return r; } @@ -2689,7 +2689,7 @@ static int setup_journal(const char *directory, uid_t uid_shift, uid_t uid_range .destination = p, .destination_uid = UID_INVALID, }, - /* n= */ 1, + /* n = */ 1, uid_shift, uid_range, arg_selinux_apifs_context, @@ -3395,7 +3395,7 @@ static int inner_child( if (r < 0) return log_error_errno(errno, "Failed to unshare cgroup namespace: %m"); - r = mount_cgroups(/* dest= */ NULL, /* accept_existing= */ false); + r = mount_cgroups(/* dest = */ NULL, /* accept_existing = */ false); } else r = bind_mount_cgroup_hierarchy(); if (r < 0) @@ -4290,7 +4290,7 @@ static int outer_child( (void) write_string_filef(p, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MODE_0444, SD_ID128_UUID_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid)); if (!arg_use_cgns) { - r = mount_cgroups(directory, /* accept_existing= */ true); + r = mount_cgroups(directory, /* accept_existing = */ true); if (r < 0) return r; } @@ -4361,11 +4361,11 @@ static int outer_child( * user if user namespaces are turned on. */ if (arg_network_namespace_path) { - r = namespace_enter(/* pidns_fd= */ -EBADF, - /* mntns_fd= */ -EBADF, + r = namespace_enter(/* pidns_fd = */ -EBADF, + /* mntns_fd = */ -EBADF, netns_fd, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF); + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF); if (r < 0) return log_error_errno(r, "Failed to join network namespace: %m"); } @@ -5686,7 +5686,7 @@ static int run_container( } else if (!isempty(arg_background)) (void) pty_forward_set_background_color(forward, arg_background); - (void) pty_forward_set_window_title(forward, GLYPH_BLUE_CIRCLE, /* hostname= */ NULL, + (void) pty_forward_set_window_title(forward, GLYPH_BLUE_CIRCLE, /* hostname = */ NULL, STRV_MAKE("Container", arg_machine)); pty_forward_set_hotkey_handler(forward, ptyfwd_hotkey, pid); @@ -6004,7 +6004,7 @@ static int run(int argc, char *argv[]) { * so just turning this off here means we only turn it off in nspawn itself, not any children. */ (void) ignore_signals(SIGPIPE); - r = fdset_new_listen_fds(&fds, /* unset= */ false); + r = fdset_new_listen_fds(&fds, /* unset = */ false); if (r < 0) { log_error_errno(r, "Failed to collect file descriptors: %m"); goto finish; diff --git a/src/nsresourced/nsresourced-manager.c b/src/nsresourced/nsresourced-manager.c index b09639bb49b..5aa429a0881 100644 --- a/src/nsresourced/nsresourced-manager.c +++ b/src/nsresourced/nsresourced-manager.c @@ -69,7 +69,7 @@ static int on_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, voi assert(s); - (void) start_workers(m, /* explicit_request= */ true); /* Workers told us there's more work, let's add one more worker as long as we are below the high watermark */ + (void) start_workers(m, /* explicit_request=*/ true); /* Workers told us there's more work, let's add one more worker as long as we are below the high watermark */ return 0; } @@ -80,7 +80,7 @@ static int on_deferred_start_worker(sd_event_source *s, uint64_t usec, void *use m->deferred_start_worker_event_source = sd_event_source_unref(m->deferred_start_worker_event_source); - (void) start_workers(m, /* explicit_request= */ false); + (void) start_workers(m, /* explicit_request=*/ false); return 0; } diff --git a/src/oom/oomd-util.c b/src/oom/oomd-util.c index 0dcca282fe0..239c335427e 100644 --- a/src/oom/oomd-util.c +++ b/src/oom/oomd-util.c @@ -250,7 +250,7 @@ int oomd_cgroup_kill(const char *path, bool recurse, bool dry_run) { if (dry_run) { _cleanup_free_ char *cg_path = NULL; - r = cg_get_path(path, /* suffix= */ NULL, &cg_path); + r = cg_get_path(path, /* suffix = */ NULL, &cg_path); if (r < 0) return r; diff --git a/src/oom/test-oomd-util.c b/src/oom/test-oomd-util.c index 87a5b03f560..7ea69c0c4bb 100644 --- a/src/oom/test-oomd-util.c +++ b/src/oom/test-oomd-util.c @@ -43,7 +43,7 @@ static int fork_and_sleep(unsigned sleep_min) { pid_t pid; int r; - ASSERT_OK(r = safe_fork("(test-oom-child)", /* flags= */ 0, &pid)); + ASSERT_OK(r = safe_fork("(test-oom-child)", /* flags = */ 0, &pid)); if (r == 0) { usec_t timeout = usec_add(now(CLOCK_MONOTONIC), sleep_min * USEC_PER_MINUTE); for (;;) { diff --git a/src/pcrextend/pcrextend.c b/src/pcrextend/pcrextend.c index d887da924fc..7af7d3211e7 100644 --- a/src/pcrextend/pcrextend.c +++ b/src/pcrextend/pcrextend.c @@ -159,7 +159,7 @@ static int parse_argv(int argc, char *argv[]) { _cleanup_free_ char *device = NULL; if (streq(optarg, "list")) - return tpm2_list_devices(/* legend= */ true, /* quiet= */ false); + return tpm2_list_devices(/* legend = */ true, /* quiet = */ false); if (!streq(optarg, "auto")) { device = strdup(optarg); diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index d8150e8b2d5..525e9c5f4ba 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -2239,7 +2239,7 @@ static int show_log_table(EventLog *el, sd_json_variant **ret_variant) { return 0; } - r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */ true); + r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, /* show_header= */true); if (r < 0) return r; @@ -4391,7 +4391,7 @@ static int determine_boot_policy_file(char **ret_path, char **ret_credential_nam /* root= */ NULL, /* conf_root= */ NULL, machine_id, - /* machine_id_is_random= */ false, + /* machine_id_is_random = */ false, &arg_entry_token_type, &arg_entry_token); if (r < 0) @@ -5401,7 +5401,7 @@ static int vl_method_read_event_log(sd_varlink *link, sd_json_variant *parameter assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -5465,7 +5465,7 @@ static int vl_method_remove_policy(sd_varlink *link, sd_json_variant *parameters assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/portable/portable.c b/src/portable/portable.c index c30fac53fe1..7dfe1aa99cc 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -740,7 +740,7 @@ static int extract_image_and_extensions( e = strv_env_pairs_get(extension_release, "PORTABLE_PREFIXES"); if (e) { - r = strv_split_and_extend(&valid_prefixes, e, WHITESPACE, /* filter_duplicates= */ true); + r = strv_split_and_extend(&valid_prefixes, e, WHITESPACE, /* filter_duplicates = */ true); if (r < 0) return r; } diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index f259769bfd3..c7803021b20 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -152,8 +152,8 @@ static int extract_prefix(const char *path, char **ret) { if (!name) return -ENOMEM; - /* A slightly reduced version of what's permitted in unit names. With ':' and '\' are removed, as well as '_' - * which we use as delimiter for the second part of the image string, which we ignore for now. */ + /* A slightly reduced version of what's permitted in unit names. With ':' and '\' are removed, as well as '_' + * which we use as delimiter for the second part of the image string, which we ignore for now. */ if (!in_charset(name, DIGITS LETTERS "-.")) return -EINVAL; diff --git a/src/ptyfwd/ptyfwd-tool.c b/src/ptyfwd/ptyfwd-tool.c index e7b5e03e15e..dd0c638f740 100644 --- a/src/ptyfwd/ptyfwd-tool.c +++ b/src/ptyfwd/ptyfwd-tool.c @@ -156,7 +156,7 @@ static int run(int argc, char *argv[]) { log_setup(); - assert_se(sigprocmask_many(SIG_BLOCK, /* ret_old_mask= */ NULL, SIGCHLD) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, /*ret_old_mask=*/ NULL, SIGCHLD) >= 0); r = parse_argv(argc, argv); if (r <= 0) @@ -172,7 +172,7 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to get event loop: %m"); - pty_fd = openpt_allocate(O_RDWR|O_NOCTTY|O_NONBLOCK|O_CLOEXEC, /* ret_peer_path= */ NULL); + pty_fd = openpt_allocate(O_RDWR|O_NOCTTY|O_NONBLOCK|O_CLOEXEC, /*ret_peer_path=*/ NULL); if (pty_fd < 0) return log_error_errno(pty_fd, "Failed to acquire pseudo tty: %m"); diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c index cc7d9d788c8..f6866213481 100644 --- a/src/quotacheck/quotacheck.c +++ b/src/quotacheck/quotacheck.c @@ -50,7 +50,7 @@ static void parse_credentials(void) { _cleanup_free_ char *value = NULL; int r; - r = read_credential("quotacheck.mode", (void**) &value, /* ret_size= */ NULL); + r = read_credential("quotacheck.mode", (void**) &value, /* ret_size = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read credential 'quotacheck.mode', ignoring: %m"); else { diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c index be74d553c5a..5cff12b3a51 100644 --- a/src/remount-fs/remount-fs.c +++ b/src/remount-fs/remount-fs.c @@ -106,7 +106,7 @@ static int remount_by_fstab(Hashmap **ret_pids) { else if (!path_equal(target, "/usr") && !mount_point_is_api(target)) continue; - r = do_remount(target, /* force_rw= */ false, &pids); + r = do_remount(target, /* force_rw = */ false, &pids); if (r < 0) return r; } @@ -140,7 +140,7 @@ static int run(int argc, char *argv[]) { log_warning_errno(r, "Failed to parse $SYSTEMD_REMOUNT_ROOT_RW, ignoring: %m"); if (r > 0) { - r = do_remount("/", /* force_rw= */ true, &pids); + r = do_remount("/", /* force_rw = */ true, &pids); if (r < 0) return r; } diff --git a/src/repart/repart.c b/src/repart/repart.c index edd4816f132..ad5f14299fb 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -2241,7 +2241,7 @@ static int config_parse_make_symlinks( continue; } - r = specifier_printf(path, PATH_MAX-1, system_and_tmp_specifier_table, arg_root, /* userdata= */ NULL, &d); + r = specifier_printf(path, PATH_MAX-1, system_and_tmp_specifier_table, arg_root, /*userdata=*/ NULL, &d); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to expand specifiers in Subvolumes= parameter, ignoring: %s", path); @@ -2295,7 +2295,7 @@ static int config_parse_subvolumes( continue; } - r = specifier_printf(path, PATH_MAX-1, system_and_tmp_specifier_table, arg_root, /* userdata= */ NULL, &d); + r = specifier_printf(path, PATH_MAX-1, system_and_tmp_specifier_table, arg_root, /*userdata=*/ NULL, &d); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to expand specifiers in Subvolumes= parameter, ignoring: %s", path); @@ -3132,7 +3132,7 @@ static int context_copy_from_one(Context *context, const char *src) { if (r < 0) return log_error_errno(r, "%s is not a file nor a block device: %m", src); - r = fdisk_new_context_at(fd, /* path= */ NULL, /* read_only= */ true, /* sector_size= */ UINT32_MAX, &c); + r = fdisk_new_context_at(fd, /* path = */ NULL, /* read_only = */ true, /* sector_size = */ UINT32_MAX, &c); if (r < 0) return log_error_errno(r, "Failed to create fdisk context: %m"); @@ -3602,7 +3602,7 @@ static int context_load_partition_table(Context *context) { context->sector_size = fdisk_get_sector_size(c); context->default_fs_sector_size = fs_secsz; context->grain_size = MAX(context->sector_size, 4096U); - return /* from_scratch= */ true; + return /* from_scratch = */ true; } r = -EINVAL; @@ -5445,7 +5445,7 @@ static int partition_format_verity_hash( return log_error_errno(r, "libcryptsetup not found, cannot setup verity: %m"); if (!node) { - r = partition_target_prepare(context, p, p->new_size, /* need_path= */ true, &t); + r = partition_target_prepare(context, p, p->new_size, /*need_path=*/ true, &t); if (r < 0) return r; @@ -5769,13 +5769,13 @@ static int context_copy_blocks(Context *context) { usec_t start_timestamp = now(CLOCK_MONOTONIC); r = partition_target_prepare(context, p, p->new_size, - /* need_path= */ p->encrypt != ENCRYPT_OFF || p->siblings[VERITY_HASH], + /*need_path=*/ p->encrypt != ENCRYPT_OFF || p->siblings[VERITY_HASH], &t); if (r < 0) return r; if (p->encrypt != ENCRYPT_OFF && t->loop) { - r = partition_encrypt(context, p, t, /* offline= */ false); + r = partition_encrypt(context, p, t, /* offline = */ false); if (r < 0) return r; } @@ -5799,7 +5799,7 @@ static int context_copy_blocks(Context *context) { log_info("Copying in of '%s' on block level completed.", p->copy_blocks_path); if (p->encrypt != ENCRYPT_OFF && !t->loop) { - r = partition_encrypt(context, p, t, /* offline= */ true); + r = partition_encrypt(context, p, t, /* offline = */ true); if (r < 0) return r; } @@ -5818,7 +5818,7 @@ static int context_copy_blocks(Context *context) { if (p->siblings[VERITY_HASH] && !partition_defer(context, p->siblings[VERITY_HASH])) { r = partition_format_verity_hash(context, p->siblings[VERITY_HASH], - /* node= */ NULL, partition_target_path(t)); + /* node = */ NULL, partition_target_path(t)); if (r < 0) return r; } @@ -6145,7 +6145,7 @@ static int file_is_denylisted(const char *source, Hashmap *denylist) { struct stat st, rst; int r; - r = chase_and_stat(source, arg_copy_source, CHASE_PREFIX_ROOT, /* ret_path= */ NULL, &st); + r = chase_and_stat(source, arg_copy_source, CHASE_PREFIX_ROOT, /*ret_path=*/ NULL, &st); if (r < 0) return log_error_errno(r, "Failed to stat source file '%s/%s': %m", strempty(arg_copy_source), source); @@ -6155,7 +6155,7 @@ static int file_is_denylisted(const char *source, Hashmap *denylist) { if (stat(empty_to_root(arg_copy_source), &rst) < 0) return log_error_errno(errno, "Failed to stat '%s': %m", empty_to_root(arg_copy_source)); - pfd = chase_and_open_parent(source, arg_copy_source, CHASE_PREFIX_ROOT, /* ret_filename= */ NULL); + pfd = chase_and_open_parent(source, arg_copy_source, CHASE_PREFIX_ROOT, /*ret_filename=*/ NULL); if (pfd < 0) return log_error_errno(pfd, "Failed to chase '%s/%s': %m", strempty(arg_copy_source), source); @@ -6793,7 +6793,7 @@ static int context_mkfs(Context *context) { * for cryptsetup's offline encryption. */ r = partition_target_prepare(context, p, p->new_size - (p->encrypt != ENCRYPT_OFF ? LUKS2_METADATA_KEEP_FREE : 0), - /* need_path= */ true, + /*need_path=*/ true, &t); if (r < 0) return r; @@ -6803,7 +6803,7 @@ static int context_mkfs(Context *context) { if (r < 0) return r; - r = partition_encrypt(context, p, t, /* offline= */ false); + r = partition_encrypt(context, p, t, /* offline = */ false); if (r < 0) return log_error_errno(r, "Failed to encrypt device: %m"); } @@ -6871,7 +6871,7 @@ static int context_mkfs(Context *context) { if (r < 0) return r; - r = partition_encrypt(context, p, t, /* offline= */ true); + r = partition_encrypt(context, p, t, /* offline = */ true); if (r < 0) return log_error_errno(r, "Failed to encrypt device: %m"); } @@ -6886,7 +6886,7 @@ static int context_mkfs(Context *context) { if (p->siblings[VERITY_HASH] && !partition_defer(context, p->siblings[VERITY_HASH])) { r = partition_format_verity_hash(context, p->siblings[VERITY_HASH], - /* node= */ NULL, partition_target_path(t)); + /* node = */ NULL, partition_target_path(t)); if (r < 0) return r; } @@ -8777,7 +8777,7 @@ static int context_load_keys(Context *context) { if (arg_certificate) { if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } @@ -8793,7 +8793,7 @@ static int context_load_keys(Context *context) { if (arg_private_key) { if (arg_private_key_source_type == OPENSSL_KEY_SOURCE_FILE) { - r = parse_path_argument(arg_private_key, /* suppress_root= */ false, &arg_private_key); + r = parse_path_argument(arg_private_key, /*suppress_root=*/ false, &arg_private_key); if (r < 0) return r; } @@ -9308,7 +9308,7 @@ static int parse_argv(int argc, char *argv[]) { _cleanup_free_ char *device = NULL; if (streq(optarg, "list")) - return tpm2_list_devices(/* legend= */ true, /* quiet= */ false); + return tpm2_list_devices(/* legend = */ true, /* quiet = */ false); if (!streq(optarg, "auto")) { device = strdup(optarg); @@ -10669,7 +10669,7 @@ static int run(int argc, char *argv[]) { if (r < 0) return r; - (void) context_dump(context, /* late= */ false); + (void) context_dump(context, /*late=*/ false); r = context_write_partition_table(context); if (r < 0) @@ -10679,7 +10679,7 @@ static int run(int argc, char *argv[]) { if (r < 0) return r; - (void) context_dump(context, /* late= */ true); + (void) context_dump(context, /*late=*/ true); context_disarm_auto_removal(context); diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index d6609fe2edc..125d89f41a5 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -1540,7 +1540,7 @@ static int map_dns_servers_internal(sd_bus *bus, const char *member, sd_bus_mess } static int map_link_dns_servers(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata) { - return map_dns_servers_internal(bus, member, m, /* flags= */ 0, error, userdata); + return map_dns_servers_internal(bus, member, m, /* flags = */ 0, error, userdata); } static int map_link_dns_servers_ex(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata) { @@ -1551,7 +1551,7 @@ static int map_link_current_dns_server(sd_bus *bus, const char *member, sd_bus_m assert(m); assert(userdata); - return read_dns_server_one(m, /* flags= */ 0, userdata); + return read_dns_server_one(m, /* flags = */ 0, userdata); } static int map_link_current_dns_server_ex(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata) { @@ -4560,7 +4560,7 @@ static int native_main(int argc, char *argv[]) { {} }; - return dispatch_verb(argc, argv, verbs, /* userdata= */ NULL); + return dispatch_verb(argc, argv, verbs, /* userdata = */ NULL); } static int translate(const char *verb, const char *single_arg, size_t num_args, char **args) { diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 9e075277ec1..d03002f42c9 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -644,7 +644,7 @@ static int bus_method_resolve_address(sd_bus_message *message, void *userdata, s if (ifindex < 0) return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid interface index"); - if (validate_and_mangle_query_flags(m, &flags, /* name= */ NULL, /* ok= */ 0) < 0) + if (validate_and_mangle_query_flags(m, &flags, /* name = */ NULL, /* ok = */ 0) < 0) return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid flags parameter"); r = dns_question_new_reverse(&question, family, &a); diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index a0ef7504471..cb1026aadcf 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -580,7 +580,7 @@ static int manager_validate_and_mangle_question(Manager *manager, DnsQuestion ** RefuseRecordTypeResult result = test_refuse_record_types(manager->refuse_record_types, *question); if (result == REFUSE_BAD) - return -ENOANO; /* All bad, refuse. */ + return -ENOANO; /* All bad, refuse.*/ if (result == REFUSE_GOOD) { *ret_allocated = NULL; return 0; /* All good. Not necessary to filter. */ diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index 83082631f79..15a0ed043be 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -685,7 +685,7 @@ int dns_server_adjust_opt(DnsServer *server, DnsPacket *packet, DnsServerFeature log_debug("Announcing packet size %zu in egress EDNS(0) packet.", packet_size); - return dns_packet_append_opt(packet, packet_size, edns_do, /* include_rfc6975= */ true, NULL, 0, NULL); + return dns_packet_append_opt(packet, packet_size, edns_do, /* include_rfc6975 = */ true, NULL, 0, NULL); } int dns_server_ifindex(const DnsServer *s) { diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index 05e5bf424d3..b2cfa4a998b 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -464,7 +464,7 @@ static int dns_stub_finish_reply_packet( assert(p); if (add_opt) { - r = dns_packet_append_opt(p, max_udp_size, edns0_do, /* include_rfc6975= */ false, nsid ? nsid_string() : NULL, rcode, NULL); + r = dns_packet_append_opt(p, max_udp_size, edns0_do, /* include_rfc6975 = */ false, nsid ? nsid_string() : NULL, rcode, NULL); if (r == -EMSGSIZE) /* Hit the size limit? then indicate truncation */ tc = true; else if (r < 0) @@ -769,7 +769,7 @@ static void dns_stub_query_complete(DnsQuery *query) { _cleanup_(dns_packet_unrefp) DnsPacket *reply = NULL; r = dns_stub_patch_bypass_reply_packet(&reply, q->answer_full_packet, q->request_packet, - /* validated= */ !FLAGS_SET(q->flags, SD_RESOLVED_NO_VALIDATE), + /* validated = */ !FLAGS_SET(q->flags, SD_RESOLVED_NO_VALIDATE), FLAGS_SET(q->answer_query_flags, SD_RESOLVED_AUTHENTICATED)); if (r < 0) log_debug_errno(r, "Failed to patch bypass reply packet: %m"); diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index d4a5dd8e17f..973ea08f432 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -988,8 +988,8 @@ static void dns_transaction_process_dnssec(DnsTransaction *t) { if (t->answer_dnssec_result == DNSSEC_INCOMPATIBLE_SERVER && t->scope->dnssec_mode == DNSSEC_YES) { - /* We are not in automatic downgrade mode, and the server is bad. Let's try a different server, maybe - * that works. */ + /* We are not in automatic downgrade mode, and the server is bad. Let's try a different server, maybe + * that works. */ if (dns_transaction_limited_retry(t)) return; @@ -1476,7 +1476,7 @@ static int on_dns_packet(sd_event_source *s, int fd, uint32_t revents, void *use assert_se(sd_event_now(t->scope->manager->event, CLOCK_BOOTTIME, &usec) >= 0); dns_server_packet_lost(t->server, IPPROTO_UDP, t->current_feature_level); - dns_transaction_close_connection(t, /* use_graveyard= */ false); + dns_transaction_close_connection(t, /* use_graveyard = */ false); if (dns_transaction_limited_retry(t)) /* Try a different server */ return 0; @@ -2073,8 +2073,8 @@ static int dns_transaction_make_packet(DnsTransaction *t) { } else { r = dns_packet_new_query( &p, t->scope->protocol, - /* min_alloc_dsize= */ 0, - /* dnssec_checking_disabled= */ !FLAGS_SET(t->query_flags, SD_RESOLVED_NO_VALIDATE) && + /* min_alloc_dsize = */ 0, + /* dnssec_checking_disabled = */ !FLAGS_SET(t->query_flags, SD_RESOLVED_NO_VALIDATE) && t->scope->dnssec_mode != DNSSEC_NO); if (r < 0) return r; diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c index 970fe1ea546..e29a9d23258 100644 --- a/src/resolve/resolved-dns-trust-anchor.c +++ b/src/resolve/resolved-dns-trust-anchor.c @@ -502,7 +502,7 @@ static int dns_trust_anchor_dump(DnsTrustAnchor *d) { else { _cleanup_free_ char **l = NULL, *j = NULL; - if (set_dump_sorted(d->negative_by_name, (void***) &l, /* ret_n= */ NULL) < 0) + if (set_dump_sorted(d->negative_by_name, (void***) &l, /* ret_n = */ NULL) < 0) return log_oom(); j = strv_join(l, " "); diff --git a/src/resolve/resolved-dnssd.c b/src/resolve/resolved-dnssd.c index d6491ea64fb..1c090f9b611 100644 --- a/src/resolve/resolved-dnssd.c +++ b/src/resolve/resolved-dnssd.c @@ -125,7 +125,7 @@ static int dnssd_registered_service_load(Manager *manager, const char *path) { return log_oom(); r = config_parse_many( - STRV_MAKE_CONST(path), DNSSD_SERVICE_DIRS, dropin_dirname, /* root= */ NULL, + STRV_MAKE_CONST(path), DNSSD_SERVICE_DIRS, dropin_dirname, /* root = */ NULL, "Service\0", config_item_perf_lookup, resolved_dnssd_gperf_lookup, CONFIG_PARSE_WARN, diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index df0b2213bef..aa4d43042cc 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -2152,10 +2152,10 @@ static int global_dns_configuration_json_append(Manager *m, sd_json_variant **co return r; return dns_configuration_json_append( - /* ifname= */ NULL, - /* ifindex= */ 0, - /* delegate= */ NULL, - /* default_route= */ -1, + /* ifname = */ NULL, + /* ifindex = */ 0, + /* delegate = */ NULL, + /* default_route = */ -1, manager_get_dns_server(m), m->dns_servers, m->fallback_dns_servers, @@ -2210,11 +2210,11 @@ static int link_dns_configuration_json_append(Link *l, sd_json_variant **configu return dns_configuration_json_append( l->ifname, l->ifindex, - /* delegate= */ NULL, + /* delegate = */ NULL, link_get_default_route(l), link_get_dns_server(l), l->dns_servers, - /* fallback_dns_servers= */ NULL, + /* fallback_dns_servers = */ NULL, l->search_domains, l->dnssec_negative_trust_anchors, scopes, @@ -2222,7 +2222,7 @@ static int link_dns_configuration_json_append(Link *l, sd_json_variant **configu link_get_dns_over_tls_mode(l), link_get_llmnr_support(l), link_get_mdns_support(l), - /* resolv_conf_mode= */ _RESOLV_CONF_MODE_INVALID, + /* resolv_conf_mode = */ _RESOLV_CONF_MODE_INVALID, configuration); } @@ -2238,21 +2238,21 @@ static int delegate_dns_configuration_json_append(DnsDelegate *d, sd_json_varian return r; return dns_configuration_json_append( - /* ifname= */ NULL, - /* ifindex= */ 0, + /* ifname = */ NULL, + /* ifindex = */ 0, d->id, d->default_route > 0, /* Defaults to false. See dns_scope_is_default_route(). */ dns_delegate_get_dns_server(d), d->dns_servers, - /* fallback_dns_servers= */ NULL, + /* fallback_dns_servers = */ NULL, d->search_domains, - /* negative_trust_anchors= */ NULL, + /* negative_trust_anchors = */ NULL, scopes, - /* dnssec_mode= */ _DNSSEC_MODE_INVALID, - /* dns_over_tls_mode= */ _DNS_OVER_TLS_MODE_INVALID, - /* llmnr_support= */ _RESOLVE_SUPPORT_INVALID, - /* mdns_support= */ _RESOLVE_SUPPORT_INVALID, - /* resolv_conf_mode= */ _RESOLV_CONF_MODE_INVALID, + /* dnssec_mode = */ _DNSSEC_MODE_INVALID, + /* dns_over_tls_mode = */ _DNS_OVER_TLS_MODE_INVALID, + /* llmnr_support = */ _RESOLVE_SUPPORT_INVALID, + /* mdns_support = */ _RESOLVE_SUPPORT_INVALID, + /* resolv_conf_mode = */ _RESOLV_CONF_MODE_INVALID, configuration); } diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h index 4f595e6d04c..7f8a0e0ceb5 100644 --- a/src/resolve/resolved-manager.h +++ b/src/resolve/resolved-manager.h @@ -123,7 +123,7 @@ typedef struct Manager { struct stat etc_hosts_stat; bool read_etc_hosts; - /* List of refused DNS Record Types */ + /* List of refused DNS Record Types*/ Set *refuse_record_types; OrderedSet *dns_extra_stub_listeners; diff --git a/src/resolve/resolved-varlink.c b/src/resolve/resolved-varlink.c index 760e8904266..f6ecc982208 100644 --- a/src/resolve/resolved-varlink.c +++ b/src/resolve/resolved-varlink.c @@ -504,7 +504,7 @@ static int vl_method_resolve_address(sd_varlink *link, sd_json_variant *paramete if (FAMILY_ADDRESS_SIZE(p.family) != p.address.iov_len) return sd_varlink_error(link, "io.systemd.Resolve.BadAddressSize", NULL); - if (validate_and_mangle_query_flags(m, &p.flags, /* name= */ NULL, /* ok= */ 0) < 0) + if (validate_and_mangle_query_flags(m, &p.flags, /* name = */ NULL, /* ok = */ 0) < 0) return sd_varlink_error_invalid_parameter(link, JSON_VARIANT_STRING_CONST("flags")); union in_addr_union a = IN_ADDR_NULL; @@ -1225,7 +1225,7 @@ static int vl_method_browse_services(sd_varlink* link, sd_json_variant* paramete if (r != 0) return r; - if (validate_and_mangle_query_flags(m, &p.flags, /* name= */ NULL, /* ok= */ 0)) + if (validate_and_mangle_query_flags(m, &p.flags, /* name = */ NULL, /* ok = */ 0)) return sd_varlink_error_invalid_parameter_name(link, "flags"); r = dns_subscribe_browse_service(m, link, p.domain, p.type, p.ifindex, p.flags); diff --git a/src/resolve/test-dns-answer.c b/src/resolve/test-dns-answer.c index 2454ca1c06b..242309069df 100644 --- a/src/resolve/test-dns-answer.c +++ b/src/resolve/test-dns-answer.c @@ -19,7 +19,7 @@ TEST(dns_answer_add_a) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_TRUE(dns_answer_contains(answer, rr)); } @@ -38,42 +38,42 @@ TEST(dns_answer_match_key_single) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(answer), 1u); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, rr->key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, rr->key, /* ret_flags = */ NULL)); ASSERT_OK_POSITIVE(dns_answer_match_key(answer, rr->key, &flags)); ASSERT_EQ((int)flags, DNS_ANSWER_CACHEABLE); /* ANY class matches */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_ANY, DNS_TYPE_A, "www.example.com")); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* ANY type matches */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_ANY, "www.example.com")); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* non-matching type */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_CNAME, "www.example.com")); - ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* name is case-insensitive */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "WWW.EXAMPLE.COM")); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* non-matching name */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "example.com")); - ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* name containing an error */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.\\example.com")); - ASSERT_ERROR(dns_answer_match_key(answer, key, /* ret_flags= */ NULL), EINVAL); + ASSERT_ERROR(dns_answer_match_key(answer, key, /* ret_flags = */ NULL), EINVAL); dns_resource_key_unref(key); } @@ -86,12 +86,12 @@ TEST(dns_answer_match_key_multiple) { ASSERT_NOT_NULL(answer = dns_answer_new(0)); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_TXT, "www.example.com")); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_SECTION_ANSWER | DNS_ANSWER_AUTHENTICATED, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_SECTION_ANSWER | DNS_ANSWER_AUTHENTICATED, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_SECTION_ANSWER | DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_SECTION_ANSWER | DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_EQ(dns_answer_size(answer), 2u); @@ -233,24 +233,24 @@ TEST(dns_answer_merge) { ASSERT_NOT_NULL(rr_a = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr_a->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(a, rr_a, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(a, rr_a, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_NOT_NULL(rr_b = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr_b->a.in_addr.s_addr = htobe32(0xc0a80180); - ASSERT_OK_POSITIVE(dns_answer_add(b, rr_b, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(b, rr_b, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_OK(dns_answer_merge(a, b, &ret)); ASSERT_TRUE(ret != a); ASSERT_TRUE(ret != b); - ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_a->key, /* ret_flags= */ NULL)); - ASSERT_OK_ZERO(dns_answer_match_key(a, rr_b->key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_a->key, /* ret_flags = */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(a, rr_b->key, /* ret_flags = */ NULL)); - ASSERT_OK_ZERO(dns_answer_match_key(b, rr_a->key, /* ret_flags= */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(b, rr_b->key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(b, rr_a->key, /* ret_flags = */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(b, rr_b->key, /* ret_flags = */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(ret, rr_a->key, /* ret_flags= */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(ret, rr_b->key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(ret, rr_a->key, /* ret_flags = */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(ret, rr_b->key, /* ret_flags = */ NULL)); } /* ================================================================ @@ -266,17 +266,17 @@ TEST(dns_answer_extend) { ASSERT_NOT_NULL(rr_a = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr_a->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(a, rr_a, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(a, rr_a, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_NOT_NULL(rr_b = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr_b->a.in_addr.s_addr = htobe32(0xc0a80180); - ASSERT_OK_POSITIVE(dns_answer_add(b, rr_b, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(b, rr_b, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); ASSERT_OK(dns_answer_extend(&a, b)); ASSERT_TRUE(a != b); - ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_a->key, /* ret_flags= */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_b->key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_a->key, /* ret_flags = */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(a, rr_b->key, /* ret_flags = */ NULL)); } /* ================================================================ @@ -294,7 +294,7 @@ static DnsAnswer* prepare_answer(void) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, *h)); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); } return TAKE_PTR(answer); @@ -329,11 +329,11 @@ TEST(dns_answer_remove_by_key) { n--; ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, *h)); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); ASSERT_OK_POSITIVE(dns_answer_remove_by_key(&answer, key)); ASSERT_EQ(dns_answer_size(answer), n); - ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); ASSERT_OK_ZERO(dns_answer_remove_by_key(&answer, key)); ASSERT_EQ(dns_answer_size(answer), n); dns_resource_key_unref(key); @@ -352,7 +352,7 @@ TEST(dns_answer_remove_by_rr) { _cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL; ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, *h)); - ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); /* remove nothing if the payload does not match */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, *h)); @@ -365,7 +365,7 @@ TEST(dns_answer_remove_by_rr) { ASSERT_OK_POSITIVE(dns_answer_remove_by_rr(&answer, rr)); ASSERT_EQ(dns_answer_size(answer), --n); - ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(answer, key, /* ret_flags = */ NULL)); } ASSERT_NULL(answer); @@ -393,15 +393,15 @@ TEST(dns_answer_remove_by_answer_keys) { ASSERT_EQ(dns_answer_size(b), 2u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); - ASSERT_OK_ZERO(dns_answer_match_key(a, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(a, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); - ASSERT_OK_POSITIVE(dns_answer_match_key(a, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(a, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "c.example.com")); - ASSERT_OK_ZERO(dns_answer_match_key(a, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(a, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); } @@ -420,62 +420,62 @@ TEST(dns_answer_copy_by_key) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */NULL)); rr = dns_resource_record_unref(rr); /* non-matching class */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_ANY, DNS_TYPE_A, "a.example.com")); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* non-matching type */ key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "a.example.com"); ASSERT_NOT_NULL(key); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* non-matching name */ key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com"); ASSERT_NOT_NULL(key); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* matching key */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 1u); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); /* add one more record with the same key */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->a.in_addr.s_addr = htobe32(0x7f000001); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); /* check if the two records are copied */ - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 2u); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); /* try again with an empty target */ target = dns_answer_unref(target); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 2u); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); /* add one more record */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr->a.in_addr.s_addr = htobe32(0x7f000001); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); /* copy with flags */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); - ASSERT_OK(dns_answer_copy_by_key(&target, source, key, DNS_ANSWER_SECTION_ANSWER, /* rrsig= */ NULL)); + ASSERT_OK(dns_answer_copy_by_key(&target, source, key, DNS_ANSWER_SECTION_ANSWER, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(target), 3u); ASSERT_TRUE(dns_answer_match_key(target, key, &flags)); ASSERT_EQ((int) flags, DNS_ANSWER_CACHEABLE | DNS_ANSWER_SECTION_ANSWER); @@ -496,36 +496,36 @@ TEST(dns_answer_move_by_key) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); /* non-matching class */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_ANY, DNS_TYPE_A, "a.example.com")); - ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 1u); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* non-matching type */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "a.example.com")); - ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 1u); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* non-matching name */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); - ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_ZERO(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 1u); ASSERT_EQ(dns_answer_size(target), 0u); dns_resource_key_unref(key); /* matching key */ ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); - ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_NULL(source); ASSERT_EQ(dns_answer_size(target), 1u); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); /* move the record back to the source */ source = TAKE_PTR(target); @@ -533,33 +533,33 @@ TEST(dns_answer_move_by_key) { /* add one more record */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr->a.in_addr.s_addr = htobe32(0x7f000001); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); /* move only a.example.com */ - ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 1u); ASSERT_EQ(dns_answer_size(target), 1u); - ASSERT_OK_ZERO(dns_answer_match_key(source, key, /* ret_flags= */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(source, key, /* ret_flags = */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); /* move the record back to the source */ - ASSERT_OK_POSITIVE(dns_answer_move_by_key(&source, &target, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_move_by_key(&source, &target, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 2u); ASSERT_EQ(dns_answer_size(target), 0u); /* add one more record */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->a.in_addr.s_addr = htobe32(0xc0a80180); - ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(source, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); /* move two records for a.example.com */ - ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags= */ 0, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_move_by_key(&target, &source, key, /* or_flags = */ 0, /* rrsig = */ NULL)); ASSERT_EQ(dns_answer_size(source), 1u); ASSERT_EQ(dns_answer_size(target), 2u); - ASSERT_OK_ZERO(dns_answer_match_key(source, key, /* ret_flags= */ NULL)); - ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags= */ NULL)); + ASSERT_OK_ZERO(dns_answer_match_key(source, key, /* ret_flags = */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_match_key(target, key, /* ret_flags = */ NULL)); dns_resource_key_unref(key); } @@ -581,7 +581,7 @@ TEST(dns_answer_has_dname_for_cname) { /* has matching dname */ ASSERT_NOT_NULL(dname = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_DNAME, "example.com")); ASSERT_NOT_NULL(dname->dname.name = strdup("v2.example.com")); - ASSERT_OK_POSITIVE(dns_answer_add(answer, dname, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, dname, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); /* no matching old suffix */ ASSERT_OK(free_and_strdup(&dname->dname.name, "www.v2.examples.com")); @@ -614,13 +614,13 @@ TEST(dns_answer_dump) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->ttl = 1200; rr->a.in_addr.s_addr = htobe32(0xc0a8017f); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE | DNS_ANSWER_SECTION_ADDITIONAL, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE | DNS_ANSWER_SECTION_ADDITIONAL, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr->ttl = 2400; rr->a.in_addr.s_addr = htobe32(0xc0a80180); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 2, 0, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 2, 0, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "c.example.com")); @@ -628,20 +628,20 @@ TEST(dns_answer_dump) { rr->a.in_addr.s_addr = htobe32(0xc0a80181); ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 3, DNS_ANSWER_AUTHENTICATED | DNS_ANSWER_SHARED_OWNER | DNS_ANSWER_SECTION_AUTHORITY | DNS_ANSWER_CACHE_FLUSH, - /* rrsig= */ NULL)); + /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_CNAME, "d.example.com")); rr->ttl = 4800; rr->cname.name = strdup("www.example.com"); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 4, DNS_ANSWER_GOODBYE | DNS_ANSWER_SECTION_ANSWER, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 4, DNS_ANSWER_GOODBYE | DNS_ANSWER_SECTION_ANSWER, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_EQ(dns_answer_size(answer), 4u); ASSERT_NOT_NULL(f = memstream_init(&ms)); dns_answer_dump(answer, f); - ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size= */ NULL)); + ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size = */ NULL)); ASSERT_STREQ(buf, "\ta.example.com IN A 192.168.1.127\t; ttl=1200 ifindex=1 cacheable section-additional\n" "\tb.example.com IN A 192.168.1.128\t; ttl=2400 ifindex=2\n" @@ -667,26 +667,26 @@ TEST(dns_answer_order_by_scope) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "a.example.com")); rr->ttl = 3600; rr->a.in_addr.s_addr = htobe32(0xa9fe0100); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 1, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "b.example.com")); rr->ttl = 3600; rr->a.in_addr.s_addr = htobe32(0xc0a80404); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 2, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 2, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "c.example.com")); rr->ttl = 3600; rr->a.in_addr.s_addr = htobe32(0xa9fefeff); - ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 3, DNS_ANSWER_CACHEABLE, /* rrsig= */ NULL)); + ASSERT_OK_POSITIVE(dns_answer_add(answer, rr, 3, DNS_ANSWER_CACHEABLE, /* rrsig = */ NULL)); dns_resource_record_unref(rr); - dns_answer_order_by_scope(answer, /* prefer_link_local= */ true); + dns_answer_order_by_scope(answer, /* prefer_link_local = */ true); ASSERT_NOT_NULL(f = memstream_init(&ms)); dns_answer_dump(answer, f); - ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size= */ NULL)); + ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size = */ NULL)); ASSERT_STREQ(buf, "\ta.example.com IN A 169.254.1.0\t; ttl=3600 ifindex=1 cacheable\n" "\tc.example.com IN A 169.254.254.255\t; ttl=3600 ifindex=3 cacheable\n" @@ -694,11 +694,11 @@ TEST(dns_answer_order_by_scope) { buf = mfree(buf); memstream_done(&ms); - dns_answer_order_by_scope(answer, /* prefer_link_local= */ false); + dns_answer_order_by_scope(answer, /* prefer_link_local = */ false); ASSERT_NOT_NULL(f = memstream_init(&ms)); dns_answer_dump(answer, f); - ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size= */ NULL)); + ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size = */ NULL)); ASSERT_STREQ(buf, "\tb.example.com IN A 192.168.4.4\t; ttl=3600 ifindex=2 cacheable\n" "\ta.example.com IN A 169.254.1.0\t; ttl=3600 ifindex=1 cacheable\n" diff --git a/src/resolve/test-dns-question.c b/src/resolve/test-dns-question.c index c30739a5952..7cf58424de3 100644 --- a/src/resolve/test-dns-question.c +++ b/src/resolve/test-dns-question.c @@ -23,7 +23,7 @@ TEST(dns_question_add) { /* zero-size question */ ASSERT_NOT_NULL(question = dns_question_new(0)); - ASSERT_ERROR(dns_question_add(question, key, /* flags= */ 0), ENOSPC); + ASSERT_ERROR(dns_question_add(question, key, /* flags = */ 0), ENOSPC); ASSERT_OK_ZERO(dns_question_contains_key(question, key)); ASSERT_EQ(dns_question_size(question), 0u); ASSERT_TRUE(dns_question_isempty(question)); @@ -31,7 +31,7 @@ TEST(dns_question_add) { /* single question */ ASSERT_NOT_NULL(question = dns_question_new(1)); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); ASSERT_OK_POSITIVE(dns_question_contains_key(question, key)); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_FALSE(dns_question_isempty(question)); @@ -107,21 +107,21 @@ TEST(dns_question_new_service) { /* no domain */ ASSERT_ERROR(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp._tcp", - /* domain= */ NULL, - /* with_txt= */ false, - /* convert_idna= */ false), EINVAL); + /* domain = */ NULL, + /* with_txt = */ false, + /* convert_idna = */ false), EINVAL); ASSERT_NULL(question); /* domain only */ ASSERT_OK(dns_question_new_service( &question, - /* service= */ NULL, - /* type= */ NULL, + /* service = */ NULL, + /* type = */ NULL, "www.example.com", - /* with_txt= */ false, - /* convert_idna= */ false)); + /* with_txt = */ false, + /* convert_idna = */ false)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "www.example.com")); @@ -133,11 +133,11 @@ TEST(dns_question_new_service) { /* convert idna without type -> ignored */ ASSERT_OK(dns_question_new_service( &question, - /* service= */ NULL, - /* type= */ NULL, + /* service = */ NULL, + /* type = */ NULL, "\xF0\x9F\x98\xB1.com", - /* with_txt= */ false, - /* convert_idna= */ true)); + /* with_txt = */ false, + /* convert_idna = */ true)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "\xF0\x9F\x98\xB1.com")); @@ -149,11 +149,11 @@ TEST(dns_question_new_service) { /* with type */ ASSERT_OK(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp._tcp", "example.com", - /* with_txt= */ false, - /* convert_idna= */ false)); + /* with_txt = */ false, + /* convert_idna = */ false)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "_xmpp._tcp.example.com")); @@ -166,11 +166,11 @@ TEST(dns_question_new_service) { /* convert idna with type */ ASSERT_OK(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp._tcp", "\xF0\x9F\x98\xB1.com", - /* with_txt= */ false, - /* convert_idna= */ true)); + /* with_txt = */ false, + /* convert_idna = */ true)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "_xmpp._tcp.xn--s38h.com")); @@ -182,11 +182,11 @@ TEST(dns_question_new_service) { /* with txt */ ASSERT_OK(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp._tcp", "\xF0\x9F\x98\xB1.com", - /* with_txt= */ true, - /* convert_idna= */ true)); + /* with_txt = */ true, + /* convert_idna = */ true)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 2u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "_xmpp._tcp.xn--s38h.com")); @@ -202,31 +202,31 @@ TEST(dns_question_new_service) { /* invalid type */ ASSERT_ERROR(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp.tcp", "example.com", - /* with_txt= */ false, - /* convert_idna= */ false), EINVAL); + /* with_txt = */ false, + /* convert_idna = */ false), EINVAL); ASSERT_NULL(question); /* invalid type (too short) */ ASSERT_ERROR(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp", "example.com", - /* with_txt= */ false, - /* convert_idna= */ false), EINVAL); + /* with_txt = */ false, + /* convert_idna = */ false), EINVAL); ASSERT_NULL(question); /* invalid type (too long) */ ASSERT_ERROR(dns_question_new_service( &question, - /* service= */ NULL, + /* service = */ NULL, "_xmpp._tcp._extra", "example.com", - /* with_txt= */ false, - /* convert_idna= */ false), EINVAL); + /* with_txt = */ false, + /* convert_idna = */ false), EINVAL); ASSERT_NULL(question); /* with service and type */ @@ -235,8 +235,8 @@ TEST(dns_question_new_service) { "service", "_xmpp._tcp", "example.com", - /* with_txt= */ false, - /* convert_idna= */ false)); + /* with_txt = */ false, + /* convert_idna = */ false)); ASSERT_NOT_NULL(question); ASSERT_EQ(dns_question_size(question), 1u); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_SRV, "service._xmpp._tcp.example.com")); @@ -249,10 +249,10 @@ TEST(dns_question_new_service) { ASSERT_ERROR(dns_question_new_service( &question, "service", - /* type= */ NULL, + /* type = */ NULL, "example.com", - /* with_txt= */ false, - /* convert_idna= */ false), EINVAL); + /* with_txt = */ false, + /* convert_idna = */ false), EINVAL); ASSERT_NULL(question); } @@ -268,23 +268,23 @@ TEST(dns_question_matches_rr) { ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "mail.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK_POSITIVE(dns_question_matches_rr(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_POSITIVE(dns_question_matches_rr(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "mail.example.com")); - ASSERT_OK_POSITIVE(dns_question_matches_rr(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_POSITIVE(dns_question_matches_rr(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_CNAME, "mail.example.com")); - ASSERT_OK_ZERO(dns_question_matches_rr(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_ZERO(dns_question_matches_rr(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); } @@ -299,33 +299,33 @@ TEST(dns_question_matches_cname_or_dname) { ASSERT_NOT_NULL(question = dns_question_new(1)); ASSERT_NOT_NULL(keya = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, keya, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, keya, /* flags = */ 0)); /* cname */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_CNAME, "www.example.com")); - ASSERT_OK_POSITIVE(dns_question_matches_cname_or_dname(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_POSITIVE(dns_question_matches_cname_or_dname(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); /* dname */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_DNAME, "example.com")); - ASSERT_OK_POSITIVE(dns_question_matches_cname_or_dname(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_POSITIVE(dns_question_matches_cname_or_dname(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); /* A record -> fail */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK_ZERO(dns_question_matches_cname_or_dname(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_ZERO(dns_question_matches_cname_or_dname(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); dns_question_unref(question); ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(keyc = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_CNAME, "example.com")); - ASSERT_OK(dns_question_add(question, keyc, /* flags= */ 0)); - ASSERT_OK(dns_question_add(question, keya, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, keyc, /* flags = */ 0)); + ASSERT_OK(dns_question_add(question, keya, /* flags = */ 0)); /* refuse cname if question has cname */ ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_CNAME, "www.example.com")); - ASSERT_OK_ZERO(dns_question_matches_cname_or_dname(question, rr, /* search_domain= */ NULL)); + ASSERT_OK_ZERO(dns_question_matches_cname_or_dname(question, rr, /* search_domain = */ NULL)); dns_resource_record_unref(rr); } @@ -349,7 +349,7 @@ TEST(dns_question_is_valid_for_query) { /* single key */ ASSERT_NOT_NULL(question = dns_question_new(1)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); ASSERT_OK_POSITIVE(dns_question_is_valid_for_query(question)); question = dns_question_unref(question); @@ -358,7 +358,7 @@ TEST(dns_question_is_valid_for_query) { /* invalid type */ ASSERT_NOT_NULL(question = dns_question_new(1)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_OPT, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); ASSERT_OK_ZERO(dns_question_is_valid_for_query(question)); question = dns_question_unref(question); @@ -367,10 +367,10 @@ TEST(dns_question_is_valid_for_query) { /* multiple keys with the same name */ ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "www.EXAMPLE.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); ASSERT_OK_POSITIVE(dns_question_is_valid_for_query(question)); question = dns_question_unref(question); @@ -379,10 +379,10 @@ TEST(dns_question_is_valid_for_query) { /* multiple keys with different names */ ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "www.example.org")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); ASSERT_OK_ZERO(dns_question_is_valid_for_query(question)); } @@ -408,7 +408,7 @@ TEST(dns_question_is_equal) { a = dns_question_unref(a); /* an address question (with NULL, self, and an empty) */ - ASSERT_OK(dns_question_new_address(&a, AF_INET, "www.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&a, AF_INET, "www.example.com", /* convert_idna = */ false)); ASSERT_NOT_NULL(a); ASSERT_OK_ZERO(dns_question_is_equal(a, NULL)); ASSERT_OK_ZERO(dns_question_is_equal(NULL, a)); @@ -419,7 +419,7 @@ TEST(dns_question_is_equal) { b = dns_question_unref(b); /* an address question (with same name) */ - ASSERT_OK(dns_question_new_address(&b, AF_INET, "www.EXAMPLE.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&b, AF_INET, "www.EXAMPLE.com", /* convert_idna = */ false)); ASSERT_NOT_NULL(b); ASSERT_OK_POSITIVE(dns_question_is_equal(a, b)); ASSERT_OK_POSITIVE(dns_question_is_equal(b, a)); @@ -427,7 +427,7 @@ TEST(dns_question_is_equal) { b = dns_question_unref(b); /* an address question (with different name) */ - ASSERT_OK(dns_question_new_address(&b, AF_INET, "www.EXAMPLE.org", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&b, AF_INET, "www.EXAMPLE.org", /* convert_idna = */ false)); ASSERT_NOT_NULL(b); ASSERT_OK_ZERO(dns_question_is_equal(a, b)); ASSERT_OK_ZERO(dns_question_is_equal(b, a)); @@ -435,7 +435,7 @@ TEST(dns_question_is_equal) { b = dns_question_unref(b); /* an address question (with different type) */ - ASSERT_OK(dns_question_new_address(&b, AF_INET6, "www.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&b, AF_INET6, "www.example.com", /* convert_idna = */ false)); ASSERT_NOT_NULL(b); ASSERT_OK_ZERO(dns_question_is_equal(a, b)); ASSERT_OK_ZERO(dns_question_is_equal(b, a)); @@ -446,11 +446,11 @@ TEST(dns_question_is_equal) { ASSERT_NOT_NULL(b = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(b, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(b, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "www.example.com")); - ASSERT_OK(dns_question_add(b, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(b, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_OK_ZERO(dns_question_is_equal(a, b)); @@ -462,11 +462,11 @@ TEST(dns_question_is_equal) { ASSERT_NOT_NULL(a = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "www.example.com")); - ASSERT_OK(dns_question_add(a, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(a, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(a, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(a, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_OK_POSITIVE(dns_question_is_equal(a, b)); @@ -486,7 +486,7 @@ TEST(dns_question_cname_redirect) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_CNAME, "www.example.com")); rr->cname.name = strdup("example.com"); - ASSERT_OK(dns_question_new_address(&expected, AF_INET, "example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&expected, AF_INET, "example.com", /* convert_idna = */ false)); ASSERT_NOT_NULL(expected); /* NULL */ @@ -501,7 +501,7 @@ TEST(dns_question_cname_redirect) { question = dns_question_unref(question); /* match cname */ - ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.com", /* convert_idna = */ false)); ASSERT_OK_POSITIVE(dns_question_cname_redirect(question, rr, &ret)); ASSERT_OK_POSITIVE(dns_question_is_equal(ret, expected)); @@ -509,14 +509,14 @@ TEST(dns_question_cname_redirect) { ret = dns_question_unref(ret); /* same name */ - ASSERT_OK(dns_question_new_address(&question, AF_INET, "example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&question, AF_INET, "example.com", /* convert_idna = */ false)); ASSERT_OK_ZERO(dns_question_cname_redirect(question, rr, &ret)); ASSERT_NULL(ret); question = dns_question_unref(question); /* no match (same domain) */ - ASSERT_OK(dns_question_new_address(&question, AF_INET, "mail.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&question, AF_INET, "mail.example.com", /* convert_idna = */ false)); ASSERT_OK_POSITIVE(dns_question_cname_redirect(question, rr, &ret)); ASSERT_OK_POSITIVE(dns_question_is_equal(ret, expected)); @@ -524,7 +524,7 @@ TEST(dns_question_cname_redirect) { ret = dns_question_unref(ret); /* no match (different domain) */ - ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.org", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.org", /* convert_idna = */ false)); ASSERT_OK_POSITIVE(dns_question_cname_redirect(question, rr, &ret)); ASSERT_OK_POSITIVE(dns_question_is_equal(ret, expected)); @@ -537,10 +537,10 @@ TEST(dns_question_cname_redirect) { ASSERT_NOT_NULL(rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_DNAME, "example.com")); rr->dname.name = strdup("v2.example.com"); - ASSERT_OK(dns_question_new_address(&expected, AF_INET, "www.v2.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&expected, AF_INET, "www.v2.example.com", /* convert_idna = */ false)); /* match dname */ - ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&question, AF_INET, "www.example.com", /* convert_idna = */ false)); ASSERT_OK_POSITIVE(dns_question_cname_redirect(question, rr, &ret)); ASSERT_OK_POSITIVE(dns_question_is_equal(ret, expected)); @@ -552,11 +552,11 @@ TEST(dns_question_cname_redirect) { ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "mail.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_OK_POSITIVE(dns_question_cname_redirect(question, rr, &ret)); @@ -589,14 +589,14 @@ TEST(dns_question_dump) { _cleanup_(dns_resource_key_unrefp) DnsResourceKey *key = NULL; ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, type, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); } ASSERT_EQ(dns_question_size(question), 3u); ASSERT_NOT_NULL(f = memstream_init(&ms)); dns_question_dump(question, f); - ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size= */ NULL)); + ASSERT_OK(memstream_finalize(&ms, &buf, /* ret_size = */ NULL)); ASSERT_STREQ(buf, "\twww.example.com IN A\n" "\twww.example.com IN AAAA\n" @@ -623,11 +623,11 @@ TEST(dns_question_first_name) { ASSERT_NOT_NULL(question = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "www.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_A, "mail.example.com")); - ASSERT_OK(dns_question_add(question, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(question, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_STREQ(dns_question_first_name(question), "www.example.com"); @@ -662,7 +662,7 @@ TEST(dns_question_merge_empty_first) { a = dns_question_unref(a); /* single question */ - ASSERT_OK(dns_question_new_address(&a, AF_INET, "www.example.com", /* convert_idna= */ false)); + ASSERT_OK(dns_question_new_address(&a, AF_INET, "www.example.com", /* convert_idna = */ false)); ASSERT_OK(dns_question_merge(NULL, a, &ret)); ASSERT_PTR_EQ(ret, a); ret = dns_question_unref(ret); @@ -685,11 +685,11 @@ TEST(dns_question_merge_empty_first) { ASSERT_NOT_NULL(b = dns_question_new(2)); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_AAAA, "www.example.com")); - ASSERT_OK(dns_question_add(b, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(b, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_NOT_NULL(key = dns_resource_key_new(DNS_CLASS_IN, DNS_TYPE_TXT, "www.example.com")); - ASSERT_OK(dns_question_add(b, key, /* flags= */ 0)); + ASSERT_OK(dns_question_add(b, key, /* flags = */ 0)); dns_resource_key_unref(key); ASSERT_OK(dns_question_merge(a, b, &ret)); diff --git a/src/run-generator/run-generator.c b/src/run-generator/run-generator.c index f64d1a78e69..edbc1adbed8 100644 --- a/src/run-generator/run-generator.c +++ b/src/run-generator/run-generator.c @@ -62,7 +62,7 @@ static int generate(void) { if (strv_isempty(arg_commands) && !arg_success_action) return 0; - r = generator_open_unit_file(arg_dest, /* source= */ NULL, "kernel-command-line.service", &f); + r = generator_open_unit_file(arg_dest, /* source = */ NULL, "kernel-command-line.service", &f); if (r < 0) return r; diff --git a/src/run/run.c b/src/run/run.c index 2505bcdf3fe..f96788620c4 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1858,8 +1858,7 @@ static int run_context_reconnect(RunContext *c) { "org.freedesktop.systemd1.Unit", "Ref", &error, - /* ret_reply= */ NULL, - /* types= */ NULL); + /* ret_reply = */ NULL, NULL); if (r < 0) { /* Hmm, the service manager probably hasn't finished reexecution just yet? Try again later. */ if (bus_error_is_connection(&error) || bus_error_is_unknown_service(&error)) @@ -2933,7 +2932,7 @@ static int make_transient_trigger_unit( if (r < 0) return bus_log_create_error(r); - r = transient_service_set_properties(m, /* pty_path= */ NULL, /* pty_fd= */ -EBADF); + r = transient_service_set_properties(m, /* pty_path = */ NULL, /* pty_fd = */ -EBADF); if (r < 0) return r; diff --git a/src/sbsign/sbsign.c b/src/sbsign/sbsign.c index ba09350e843..68e1f24ac27 100644 --- a/src/sbsign/sbsign.c +++ b/src/sbsign/sbsign.c @@ -126,7 +126,7 @@ static int parse_argv(int argc, char *argv[]) { return version(); case ARG_OUTPUT: - r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_output); + r = parse_path_argument(optarg, /*suppress_root=*/ false, &arg_output); if (r < 0) return r; @@ -257,7 +257,7 @@ static int spc_indirect_data_content_new(const void *digest, size_t digestsz, ui if (!idc->data->value->value.sequence) return log_oom(); - idc->data->type = OBJ_txt2obj(SPC_PE_IMAGE_DATA_OBJID, /* no_name= */ 1); + idc->data->type = OBJ_txt2obj(SPC_PE_IMAGE_DATA_OBJID, /*no_name=*/ 1); if (!idc->data->type) return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to get SpcPeImageData object: %s", ERR_error_string(ERR_get_error(), NULL)); @@ -465,7 +465,7 @@ static int verb_sign(int argc, char *argv[], void *userdata) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No output specified, use --output="); if (arg_certificate_source_type == OPENSSL_CERTIFICATE_SOURCE_FILE) { - r = parse_path_argument(arg_certificate, /* suppress_root= */ false, &arg_certificate); + r = parse_path_argument(arg_certificate, /*suppress_root=*/ false, &arg_certificate); if (r < 0) return r; } diff --git a/src/shared/battery-util.c b/src/shared/battery-util.c index 8ca9a6d4b2b..c300194961c 100644 --- a/src/shared/battery-util.c +++ b/src/shared/battery-util.c @@ -189,7 +189,7 @@ int battery_enumerator_new(sd_device_enumerator **ret) { if (r < 0) return r; - r = sd_device_enumerator_add_match_subsystem(e, "power_supply", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "power_supply", /* match = */ true); if (r < 0) return r; @@ -197,15 +197,15 @@ int battery_enumerator_new(sd_device_enumerator **ret) { if (r < 0) return r; - r = sd_device_enumerator_add_match_sysattr(e, "type", "Battery", /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(e, "type", "Battery", /* match = */ true); if (r < 0) return r; - r = sd_device_enumerator_add_match_sysattr(e, "present", "1", /* match= */ true); + r = sd_device_enumerator_add_match_sysattr(e, "present", "1", /* match = */ true); if (r < 0) return r; - r = sd_device_enumerator_add_match_sysattr(e, "scope", "Device", /* match= */ false); + r = sd_device_enumerator_add_match_sysattr(e, "scope", "Device", /* match = */ false); if (r < 0) return r; diff --git a/src/shared/blockdev-list.c b/src/shared/blockdev-list.c index d856b1cb48c..6897ea6bcad 100644 --- a/src/shared/blockdev-list.c +++ b/src/shared/blockdev-list.c @@ -110,7 +110,7 @@ int blockdev_list(BlockDevListFlags flags, BlockDevice **ret_devices, size_t *re if (sd_device_enumerator_new(&e) < 0) return log_oom(); - r = sd_device_enumerator_add_match_subsystem(e, "block", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "block", /* match = */ true); if (r < 0) return log_error_errno(r, "Failed to add subsystem match: %m"); diff --git a/src/shared/blockdev-util.c b/src/shared/blockdev-util.c index 3242ea23da5..bac1471cee2 100644 --- a/src/shared/blockdev-util.c +++ b/src/shared/blockdev-util.c @@ -728,7 +728,7 @@ int partition_enumerator_new(sd_device *dev, sd_device_enumerator **ret) { if (r < 0) return r; - r = sd_device_enumerator_add_match_subsystem(e, "block", /* match= */ true); + r = sd_device_enumerator_add_match_subsystem(e, "block", /* match = */ true); if (r < 0) return r; diff --git a/src/shared/bpf-link.c b/src/shared/bpf-link.c index 72d374c2359..c83ebd48040 100644 --- a/src/shared/bpf-link.c +++ b/src/shared/bpf-link.c @@ -13,7 +13,7 @@ bool bpf_can_link_program(struct bpf_program *prog) { return false; /* Pass invalid cgroup fd intentionally. */ - link = sym_bpf_program__attach_cgroup(prog, /* cgroup_fd= */ -1); + link = sym_bpf_program__attach_cgroup(prog, /*cgroup_fd=*/-1); /* EBADF indicates that bpf_link is supported by kernel. */ return bpf_get_error_translated(link) == -EBADF; diff --git a/src/shared/bpf-program.c b/src/shared/bpf-program.c index 55b0fc284de..f9200518321 100644 --- a/src/shared/bpf-program.c +++ b/src/shared/bpf-program.c @@ -61,7 +61,7 @@ int bpf_program_supported(void) { * As our baseline on the kernel is v5.4, it is enough to check if one BPF program can be created and loaded. */ _cleanup_(bpf_program_freep) BPFProgram *program = NULL; - r = bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, /* prog_name= */ NULL, &program); + r = bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, /* prog_name = */ NULL, &program); if (r < 0) return cached = log_debug_errno(r, "Can't allocate CGROUP SKB BPF program, assuming BPF is not supported: %m"); @@ -73,7 +73,7 @@ int bpf_program_supported(void) { if (r < 0) return cached = log_debug_errno(r, "Can't add trivial instructions to CGROUP SKB BPF program, assuming BPF is not supported: %m"); - r = bpf_program_load_kernel(program, /* log_buf= */ NULL, /* log_size= */ 0); + r = bpf_program_load_kernel(program, /* log_buf = */ NULL, /* log_size = */ 0); if (r < 0) return cached = log_debug_errno(r, "Can't load kernel CGROUP SKB BPF program, assuming BPF is not supported: %m"); diff --git a/src/shared/bus-map-properties.c b/src/shared/bus-map-properties.c index 49b1e44030e..2faa5cf387e 100644 --- a/src/shared/bus-map-properties.c +++ b/src/shared/bus-map-properties.c @@ -40,7 +40,7 @@ int bus_map_job_id(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_er assert(m); - return sd_bus_message_read(m, "(uo)", p, /* path= */ NULL); + return sd_bus_message_read(m, "(uo)", p, /* path = */ NULL); } static int map_basic(sd_bus_message *m, unsigned flags, void *userdata) { diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c index 3d32726f4e3..5624e022a16 100644 --- a/src/shared/bus-polkit.c +++ b/src/shared/bus-polkit.c @@ -138,7 +138,7 @@ int bus_test_polkit( _cleanup_(sd_bus_message_unrefp) sd_bus_message *request = NULL, *reply = NULL; int authorized = false, challenge = false; - r = bus_message_new_polkit_auth_call_for_bus(call, action, details, /* flags= */ 0, &request); + r = bus_message_new_polkit_auth_call_for_bus(call, action, details, /* flags = */ 0, &request); if (r < 0) return r; diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 98ccc7cf2d7..dc9256562ae 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -3106,7 +3106,7 @@ static int unit_freezer_action(UnitFreezer *f, bool freeze) { r = bus_call_method(f->bus, bus_systemd_mgr, freeze ? "FreezeUnit" : "ThawUnit", &error, - /* ret_reply= */ NULL, + /* ret_reply = */ NULL, "s", f->name); if (r < 0) { diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index c8d4c47f731..1b3779633e4 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -930,7 +930,7 @@ int bus_get_instance_id(sd_bus *bus, sd_id128_t *ret) { r = sd_bus_call_method(bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "GetId", - /* reterr_error= */ NULL, &reply, NULL); + /* reterr_error = */ NULL, &reply, NULL); if (r < 0) return r; diff --git a/src/shared/bus-wait-for-jobs.c b/src/shared/bus-wait-for-jobs.c index ba9a162fcd3..be3a7c1cbcf 100644 --- a/src/shared/bus-wait-for-jobs.c +++ b/src/shared/bus-wait-for-jobs.c @@ -62,7 +62,7 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *re assert(m); - r = sd_bus_message_read(m, "uoss", /* id= */ NULL, &path, &unit, &result); + r = sd_bus_message_read(m, "uoss", /* id = */ NULL, &path, &unit, &result); if (r < 0) { bus_log_parse_error(r); return 0; diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 88a4467187c..0f644d444ac 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -326,7 +326,7 @@ static void _format_chain(FILE *f, int space, const CalendarComponent *c, bool s } static void format_chain(FILE *f, int space, const CalendarComponent *c, bool usec) { - _format_chain(f, space, c, /* start= */ true, usec); + _format_chain(f, space, c, /* start = */ true, usec); } int calendar_spec_to_string(const CalendarSpec *c, char **ret) { @@ -1436,7 +1436,7 @@ int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *ret_n SAVE_TIMEZONE; - r = RET_NERRNO(setenv("TZ", spec->timezone, /* overwrite= */ true)); + r = RET_NERRNO(setenv("TZ", spec->timezone, /* overwrite = */ true)); if (r < 0) return r; diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c index 65b0e8b8f45..a3348058710 100644 --- a/src/shared/cgroup-setup.c +++ b/src/shared/cgroup-setup.c @@ -78,18 +78,18 @@ int cg_trim(const char *path, bool delete_root) { _cleanup_free_ char *fs = NULL; int r; - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; r = recurse_dir_at( AT_FDCWD, fs, - /* statx_mask= */ 0, - /* n_depth_max= */ UINT_MAX, + /* statx_mask = */ 0, + /* n_depth_max = */ UINT_MAX, RECURSE_DIR_ENSURE_TYPE, trim_cb, - /* userdata= */ NULL); + /* userdata = */ NULL); if (r == -ENOENT) /* non-existing is the ultimate trimming, hence no error */ r = 0; else if (r < 0) @@ -115,7 +115,7 @@ int cg_create(const char *path) { _cleanup_free_ char *fs = NULL; int r; - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -216,7 +216,7 @@ int cg_set_access( return 0; /* Configure access to the cgroup itself */ - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -289,7 +289,7 @@ int cg_set_access_recursive( if (!uid_is_valid(uid) && !gid_is_valid(gid)) return 0; - r = cg_get_path(path, /* suffix= */ NULL, &fs); + r = cg_get_path(path, /* suffix = */ NULL, &fs); if (r < 0) return r; @@ -363,7 +363,7 @@ int cg_migrate( done = false; - r = set_ensure_put(&s, /* hash_ops= */ NULL, PID_TO_PTR(pid)); + r = set_ensure_put(&s, /* hash_ops = */ NULL, PID_TO_PTR(pid)); if (r < 0) return RET_GATHER(ret, r); } diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index 109fe016f53..94b8d15bec1 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -108,7 +108,7 @@ static int show_cgroup_one_by_path( * * ENODEV is generated when we enumerate processes from a cgroup and the cgroup is removed * concurrently. */ - r = cg_read_pid(f, &pid, /* flags= */ 0); + r = cg_read_pid(f, &pid, /* flags = */ 0); if (IN_SET(r, 0, -EOPNOTSUPP, -ENODEV)) break; if (r < 0) @@ -306,7 +306,7 @@ int show_cgroup(const char *path, assert(path); - r = cg_get_path(path, /* suffix= */ NULL, &p); + r = cg_get_path(path, /* suffix = */ NULL, &p); if (r < 0) return r; diff --git a/src/shared/chown-recursive.c b/src/shared/chown-recursive.c index 850e495836b..73e8b98871f 100644 --- a/src/shared/chown-recursive.c +++ b/src/shared/chown-recursive.c @@ -27,7 +27,7 @@ static int chown_one( /* Drop any ACL if there is one */ FOREACH_STRING(n, "system.posix_acl_access", "system.posix_acl_default") { - r = xremovexattr(fd, /* path= */ NULL, AT_EMPTY_PATH, n); + r = xremovexattr(fd, /* path = */ NULL, AT_EMPTY_PATH, n); if (r < 0 && !ERRNO_IS_NEG_XATTR_ABSENT(r)) return r; } diff --git a/src/shared/condition.c b/src/shared/condition.c index 15e3ee9840c..186f0b6c4a0 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -775,7 +775,7 @@ static int condition_test_needs_update(Condition *c, char **env) { assert(c->parameter); assert(c->type == CONDITION_NEEDS_UPDATE); - r = proc_cmdline_get_bool("systemd.condition_needs_update", /* flags= */ 0, &b); + r = proc_cmdline_get_bool("systemd.condition_needs_update", /* flags = */ 0, &b); if (r < 0) log_debug_errno(r, "Failed to parse systemd.condition_needs_update= kernel command line argument, ignoring: %m"); if (r > 0) @@ -955,7 +955,7 @@ static int condition_test_path_is_mount_point(Condition *c, char **env) { assert(c->parameter); assert(c->type == CONDITION_PATH_IS_MOUNT_POINT); - return path_is_mount_point_full(c->parameter, /* root= */ NULL, AT_SYMLINK_FOLLOW) > 0; + return path_is_mount_point_full(c->parameter, /* root = */ NULL, AT_SYMLINK_FOLLOW) > 0; } static int condition_test_path_is_read_write(Condition *c, char **env) { diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index a9afd51d0e4..595180a6fd0 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -690,7 +690,7 @@ static int dropins_get_stats_by_path( if (!strextend(&dropin_dirname, ".d")) return -ENOMEM; - r = conf_files_list_dropins(&files, dropin_dirname, /* root= */ NULL, conf_file_dirs); + r = conf_files_list_dropins(&files, dropin_dirname, /* root = */ NULL, conf_file_dirs); if (r < 0) return r; @@ -1359,7 +1359,7 @@ int config_parse_strv( return log_oom(); } - r = strv_extend_strv_consume(sv, TAKE_PTR(strv), /* filter_duplicates= */ ltype); + r = strv_extend_strv_consume(sv, TAKE_PTR(strv), /* filter_duplicates = */ ltype); if (r < 0) return log_oom(); @@ -2083,7 +2083,7 @@ int config_parse_unsigned_bounded( return ignoring ? 0 : r; } if (r < 0) - return log_syntax_parse_error_full(unit, filename, line, r, /* critical= */ !ignoring, lvalue, rvalue); + return log_syntax_parse_error_full(unit, filename, line, r, /* critical = */ !ignoring, lvalue, rvalue); return 1; /* Return 1 if something was set */ } diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h index ce47ae3173b..7cc00f3cf75 100644 --- a/src/shared/conf-parser.h +++ b/src/shared/conf-parser.h @@ -165,7 +165,7 @@ static inline bool section_is_invalid(ConfigSection *section) { #define log_section_full_errno_zerook(section, level, error, ...) \ ({ \ const ConfigSection *_s = (section); \ - log_syntax(/* unit= */ NULL, \ + log_syntax(/* unit = */ NULL, \ level, \ _s ? _s->filename : NULL, \ _s ? _s->line : 0, \ diff --git a/src/shared/copy.c b/src/shared/copy.c index 05987593137..f88d1617b13 100644 --- a/src/shared/copy.c +++ b/src/shared/copy.c @@ -938,7 +938,7 @@ static int fd_copy_regular( if (fdt < 0) return -errno; - r = prepare_nocow(fdf, /* from= */ NULL, fdt, /* chattr_mask= */ NULL, /* chattr_flags= */ NULL); + r = prepare_nocow(fdf, /*from=*/ NULL, fdt, /*chattr_mask=*/ NULL, /*chattr_flags=*/ NULL); if (r < 0) return r; @@ -1583,7 +1583,7 @@ int copy_file_at_full( return fdt; } - r = prepare_nocow(fdf, /* from= */ NULL, fdt, &chattr_mask, &chattr_flags); + r = prepare_nocow(fdf, /*from=*/ NULL, fdt, &chattr_mask, &chattr_flags); if (r < 0) return r; @@ -1784,7 +1784,7 @@ int copy_xattr(int df, const char *from, int dt, const char *to, CopyFlags copy_ if (r < 0) return r; - RET_GATHER(ret, xsetxattr_full(dt, to, /* at_flags= */ 0, p, value, value_size, /* xattr_flags= */ 0)); + RET_GATHER(ret, xsetxattr_full(dt, to, /* at_flags = */ 0, p, value, value_size, /* xattr_flags = */ 0)); } return ret; diff --git a/src/shared/cpu-set-util.c b/src/shared/cpu-set-util.c index e4ef36da9aa..a9bdd235f81 100644 --- a/src/shared/cpu-set-util.c +++ b/src/shared/cpu-set-util.c @@ -309,16 +309,16 @@ int parse_cpu_set(const char *s, CPUSet *ret) { assert(ret); r = config_parse_cpu_set( - /* unit= */ NULL, - /* filename= */ NULL, - /* line= */ 0, - /* section= */ NULL, - /* section_line= */ 0, - /* lvalue= */ NULL, - /* ltype= */ 1, - /* rvalue= */ s, - /* data= */ &c, - /* userdata= */ NULL); + /* unit = */ NULL, + /* filename = */ NULL, + /* line = */ 0, + /* section = */ NULL, + /* section_line = */ 0, + /* lvalue = */ NULL, + /* ltype = */ 1, + /* rvalue = */ s, + /* data = */ &c, + /* userdata = */ NULL); if (r < 0) return r; diff --git a/src/shared/daemon-util.c b/src/shared/daemon-util.c index ce75faf274f..21ccfdfd365 100644 --- a/src/shared/daemon-util.c +++ b/src/shared/daemon-util.c @@ -14,7 +14,7 @@ int notify_remove_fd_warn(const char *name) { assert(name); - r = sd_notifyf(/* unset_environment= */ false, + r = sd_notifyf(/* unset_environment = */ false, "FDSTOREREMOVE=1\n" "FDNAME=%s", name); if (r < 0) @@ -62,7 +62,7 @@ int notify_push_fd(int fd, const char *name) { /* Remove existing fds with the same name in fdstore. */ (void) notify_remove_fd_warn(name); - return sd_pid_notify_with_fds(0, /* unset_environment= */ false, state, &fd, 1); + return sd_pid_notify_with_fds(0, /* unset_environment = */ false, state, &fd, 1); } int notify_push_fdf(int fd, const char *format, ...) { @@ -85,7 +85,7 @@ int notify_push_fdf(int fd, const char *format, ...) { int notify_reloading_full(const char *status) { int r; - r = sd_notifyf(/* unset_environment= */ false, + r = sd_notifyf(/* unset_environment = */ false, "RELOADING=1\n" "MONOTONIC_USEC=" USEC_FMT "%s%s", diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c index b09181a73ad..8615a256cd5 100644 --- a/src/shared/discover-image.c +++ b/src/shared/discover-image.c @@ -1898,13 +1898,13 @@ int image_set_pool_limit(RuntimeScope scope, ImageClass class, uint64_t referenc if (r < 0) return r; - r = btrfs_qgroup_set_limit(pool, /* qgroupid= */ 0, referenced_max); + r = btrfs_qgroup_set_limit(pool, /* qgroupid = */ 0, referenced_max); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) return r; if (r < 0) log_debug_errno(r, "Failed to set limit on btrfs quota group for '%s', ignoring: %m", pool); - r = btrfs_subvol_set_subtree_quota_limit(pool, /* subvol_id= */ 0, referenced_max); + r = btrfs_subvol_set_subtree_quota_limit(pool, /* subvol_id = */ 0, referenced_max); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) return r; if (r < 0) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 05c25145934..6bc6b66722b 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -960,7 +960,7 @@ static int dissect_image( return r; if (FLAGS_SET(flags, DISSECT_IMAGE_PIN_PARTITION_DEVICES)) { - mount_node_fd = open_partition(devname, /* is_partition= */ false, m->loop); + mount_node_fd = open_partition(devname, /* is_partition = */ false, m->loop); if (mount_node_fd < 0) return mount_node_fd; } @@ -1423,7 +1423,7 @@ static int dissect_image( if (FLAGS_SET(flags, DISSECT_IMAGE_PIN_PARTITION_DEVICES) && type.designator != PARTITION_SWAP) { - mount_node_fd = open_partition(node, /* is_partition= */ true, m->loop); + mount_node_fd = open_partition(node, /* is_partition = */ true, m->loop); if (mount_node_fd < 0) return mount_node_fd; } @@ -1517,7 +1517,7 @@ static int dissect_image( continue; if (FLAGS_SET(flags, DISSECT_IMAGE_PIN_PARTITION_DEVICES)) { - mount_node_fd = open_partition(node, /* is_partition= */ true, m->loop); + mount_node_fd = open_partition(node, /* is_partition = */ true, m->loop); if (mount_node_fd < 0) return mount_node_fd; } @@ -1620,7 +1620,7 @@ static int dissect_image( const char *options; if (FLAGS_SET(flags, DISSECT_IMAGE_PIN_PARTITION_DEVICES)) { - mount_node_fd = open_partition(generic_node, /* is_partition= */ true, m->loop); + mount_node_fd = open_partition(generic_node, /* is_partition = */ true, m->loop); if (mount_node_fd < 0) return mount_node_fd; } @@ -2491,7 +2491,7 @@ int dissected_image_mount( int slash_boot_is_available = 0; if (where) { - r = slash_boot_is_available = mount_point_is_available(where, "/boot", /* missing_ok= */ true); + r = slash_boot_is_available = mount_point_is_available(where, "/boot", /* missing_ok = */ true); if (r < 0) return r; } @@ -2511,7 +2511,7 @@ int dissected_image_mount( * and is empty. */ if (slash_boot_is_available) { - r = mount_point_is_available(where, "/boot", /* missing_ok= */ false); + r = mount_point_is_available(where, "/boot", /* missing_ok = */ false); if (r < 0) return r; if (r > 0) @@ -2519,7 +2519,7 @@ int dissected_image_mount( } if (!esp_path) { - r = mount_point_is_available(where, "/efi", /* missing_ok= */ true); + r = mount_point_is_available(where, "/efi", /* missing_ok = */ true); if (r < 0) return r; if (r > 0) diff --git a/src/shared/dns-answer.c b/src/shared/dns-answer.c index bfc6aef6f55..eaf2b19a18d 100644 --- a/src/shared/dns-answer.c +++ b/src/shared/dns-answer.c @@ -896,7 +896,7 @@ int dns_answer_to_json(DnsAnswer *answer, sd_json_variant **ret) { } if (!ja) - return sd_json_variant_new_array(ret, /* array= */ NULL, /* n= */ 0); + return sd_json_variant_new_array(ret, /* array=*/ NULL, /* n= */ 0); *ret = TAKE_PTR(ja); return 0; diff --git a/src/shared/edit-util.c b/src/shared/edit-util.c index 3ebf4a88cda..2887e7fa292 100644 --- a/src/shared/edit-util.c +++ b/src/shared/edit-util.c @@ -475,7 +475,7 @@ int do_edit_files_and_install(EditFileContext *context) { return log_error_errno(r, "Failed to read stdin: %m"); } else { FOREACH_ARRAY(editfile, context->files, context->n_files) { - r = create_edit_temp_file(editfile, /* contents= */ NULL, /* contents_size= */ 0); + r = create_edit_temp_file(editfile, /* contents = */ NULL, /* contents_size = */ 0); if (r < 0) return r; } diff --git a/src/shared/exec-util.c b/src/shared/exec-util.c index 673460efb65..3710717e547 100644 --- a/src/shared/exec-util.c +++ b/src/shared/exec-util.c @@ -324,7 +324,7 @@ int execute_directories( return 0; } - return execute_strv(name, paths, /* root= */ NULL, timeout, callbacks, callback_args, argv, envp, flags); + return execute_strv(name, paths, /* root = */ NULL, timeout, callbacks, callback_args, argv, envp, flags); } static int gather_environment_generate(int fd, void *arg) { @@ -361,7 +361,7 @@ static int gather_environment_generate(int fd, void *arg) { if (r < 0) return r; - if (setenv(*x, *y, /* overwrite= */ true) < 0) + if (setenv(*x, *y, /* overwrite = */ true) < 0) return -errno; } diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c index 8032e131f7e..0f4073a0857 100644 --- a/src/shared/firewall-util.c +++ b/src/shared/firewall-util.c @@ -649,7 +649,7 @@ static int nft_add_element( * This replicated here and each element gets added to the set * one-by-one. */ - r = sd_nfnl_nft_message_new_setelems(nfnl, &m, /* add= */ true, nfproto, table_name, set_name); + r = sd_nfnl_nft_message_new_setelems(nfnl, &m, /* add = */ true, nfproto, table_name, set_name); if (r < 0) return r; @@ -693,7 +693,7 @@ static int nft_del_element( assert(key); assert(data || dlen == 0); - r = sd_nfnl_nft_message_new_setelems(nfnl, &m, /* add= */ false, nfproto, table_name, set_name); + r = sd_nfnl_nft_message_new_setelems(nfnl, &m, /* add = */ false, nfproto, table_name, set_name); if (r < 0) return r; diff --git a/src/shared/fork-notify.c b/src/shared/fork-notify.c index 424908ac3ed..cf014c25930 100644 --- a/src/shared/fork-notify.c +++ b/src/shared/fork-notify.c @@ -109,7 +109,7 @@ int fork_notify(char * const *argv, PidRef *ret_pidref) { SD_EVENT_PRIORITY_NORMAL-10, /* We want the notification message from the child before the SIGCHLD */ on_child_notify, &child, - /* accept_fds= */ false, + /* accept_fds = */ false, &addr_string, ¬ify_event_source); if (r < 0) diff --git a/src/shared/format-table.c b/src/shared/format-table.c index 9e366ce5134..8d6e04f0fe1 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -1687,7 +1687,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas else ret = format_timestamp_relative_full(p, FORMAT_TIMESTAMP_RELATIVE_MAX, d->timestamp, CLOCK_REALTIME, - /* implicit_left= */ d->type == TABLE_TIMESTAMP_LEFT); + /* implicit_left = */ d->type == TABLE_TIMESTAMP_LEFT); if (!ret) return "-"; diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index 25e229bf3e2..da9c691de61 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -270,7 +270,7 @@ int fstab_filter_options( } if (ret_filtered) { - filtered = strv_join_full(filtered_strv, ",", NULL, /* escape_separator= */ true); + filtered = strv_join_full(filtered_strv, ",", NULL, /* escape_separator = */ true); if (!filtered) return -ENOMEM; } diff --git a/src/shared/generator.c b/src/shared/generator.c index a419fa4e187..10187760030 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -233,7 +233,7 @@ static int write_fsck_sysroot_service( if (r < 0) return log_error_errno(r, "Failed to convert device \"%s\" to unit name: %m", what); - r = generator_open_unit_file(dir, /* source= */ NULL, unit, &f); + r = generator_open_unit_file(dir, /* source = */ NULL, unit, &f); if (r < 0) return r; @@ -578,7 +578,7 @@ int generator_hook_up_mkswap( return log_error_errno(r, "Failed to make unit name from path \"%s\": %m", what); - r = generator_open_unit_file(dir, /* source= */ NULL, unit, &f); + r = generator_open_unit_file(dir, /* source = */ NULL, unit, &f); if (r < 0) return r; @@ -660,7 +660,7 @@ int generator_hook_up_mkfs( return log_error_errno(r, "Failed to make unit name from path \"%s\": %m", where); - r = generator_open_unit_file(dir, /* source= */ NULL, unit, &f); + r = generator_open_unit_file(dir, /* source = */ NULL, unit, &f); if (r < 0) return r; diff --git a/src/shared/hibernate-util.c b/src/shared/hibernate-util.c index 001eaa920cc..5bcf7cdf960 100644 --- a/src/shared/hibernate-util.c +++ b/src/shared/hibernate-util.c @@ -56,10 +56,11 @@ int read_fiemap(int fd, struct fiemap **ret) { if (!result_fiemap) return -ENOMEM; - /* XFS filesystem has incorrect implementation of fiemap ioctl and - * returns extents for only one block-group at a time, so we need - * to handle it manually, starting the next fiemap call from the end - * of the last extent. */ + /* XFS filesystem has incorrect implementation of fiemap ioctl and + * returns extents for only one block-group at a time, so we need + * to handle it manually, starting the next fiemap call from the end + * of the last extent + */ while (fiemap_start < fiemap_length) { *fiemap = (struct fiemap) { .fm_start = fiemap_start, @@ -124,7 +125,7 @@ static int read_resume_config(dev_t *ret_devno, uint64_t *ret_offset) { assert(ret_devno); assert(ret_offset); - r = proc_cmdline_get_key("noresume", /* flags= */ 0, /* ret_value= */ NULL); + r = proc_cmdline_get_key("noresume", /* flags = */ 0, /* ret_value = */ NULL); if (r < 0) return log_debug_errno(r, "Failed to check if 'noresume' kernel command line option is set: %m"); if (r > 0) diff --git a/src/shared/hostname-setup.c b/src/shared/hostname-setup.c index 50a0f077fa7..0eb05d3714f 100644 --- a/src/shared/hostname-setup.c +++ b/src/shared/hostname-setup.c @@ -404,7 +404,7 @@ int pidref_gethostname_full(PidRef *pidref, GetHostnameFlags flags, char **ret) return r; char buf[LINUX_HOST_NAME_MAX+1]; - ssize_t n = loop_read(result_pipe[0], buf, sizeof(buf), /* do_poll= */ false); + ssize_t n = loop_read(result_pipe[0], buf, sizeof(buf), /* do_poll = */ false); if (n < 0) return n; if (n == 0 || buf[n - 1] != '\0') diff --git a/src/shared/install.c b/src/shared/install.c index a22c6df2f7b..81954365642 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -485,7 +485,7 @@ void install_changes_dump( assert(verb); - r = install_change_dump_error(i, &err_message, /* ret_bus_error= */ NULL); + r = install_change_dump_error(i, &err_message, /* ret_bus_error = */ NULL); if (r == -ENOMEM) return (void) log_oom(); if (r < 0) @@ -1988,7 +1988,7 @@ static int install_info_symlink_alias( } bool broken; - r = chase(alias_path, lp->root_dir, CHASE_NONEXISTENT, /* ret_path= */ NULL, /* ret_fd= */ NULL); + r = chase(alias_path, lp->root_dir, CHASE_NONEXISTENT, /* ret_path = */ NULL, /* ret_fd = */ NULL); if (r < 0 && r != -ENOENT) { RET_GATHER(ret, r); continue; @@ -2090,7 +2090,7 @@ static int install_info_symlink_wants( if (!path) return -ENOMEM; - q = create_symlink(lp, info->path, path, /* force= */ true, changes, n_changes); + q = create_symlink(lp, info->path, path, /* force = */ true, changes, n_changes); if (q != 0 && r >= 0) r = q; @@ -2519,7 +2519,7 @@ int unit_file_link( if (!full) return -ENOMEM; - r = verify_regular_at(AT_FDCWD, full, /* follow= */ false); + r = verify_regular_at(AT_FDCWD, full, /* follow = */ false); if (r < 0) return install_changes_add(changes, n_changes, r, *file, NULL); diff --git a/src/shared/journal-file-util.c b/src/shared/journal-file-util.c index 8aecda96105..6591744c512 100644 --- a/src/shared/journal-file-util.c +++ b/src/shared/journal-file-util.c @@ -511,7 +511,7 @@ int journal_file_open_reliably( compress_threshold_bytes, metrics, mmap_cache, - /* template= */ NULL, + /* template = */ NULL, ret); if (!IN_SET(r, -EBADMSG, /* Corrupted */ @@ -542,7 +542,7 @@ int journal_file_open_reliably( r = journal_file_open(-EBADF, fname, (open_flags & ~(O_ACCMODE_STRICT|O_CREAT|O_EXCL)) | O_RDONLY, file_flags, 0, compress_threshold_bytes, NULL, - mmap_cache, /* template= */ NULL, &old_file); + mmap_cache, /* template = */ NULL, &old_file); if (r < 0) log_debug_errno(r, "Failed to continue sequence from file %s, ignoring: %m", fname); @@ -551,7 +551,7 @@ int journal_file_open_reliably( return r; return journal_file_open(-EBADF, fname, open_flags, file_flags, mode, compress_threshold_bytes, metrics, - mmap_cache, /* template= */ old_file, ret); + mmap_cache, /* template = */ old_file, ret); } DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR( diff --git a/src/shared/kernel-image.c b/src/shared/kernel-image.c index ed8fde1fb21..73a78a920ce 100644 --- a/src/shared/kernel-image.c +++ b/src/shared/kernel-image.c @@ -42,7 +42,7 @@ static int uki_read_pretty_name( pe_header, sections, ".osrel", - /* max_size= */ PE_SECTION_READ_MAX, + /* max_size=*/ PE_SECTION_READ_MAX, &osrel, &osrel_size); if (r == -ENXIO) { /* Section not found */ diff --git a/src/shared/label-util.c b/src/shared/label-util.c index 6c6e73bab34..f797f49afc5 100644 --- a/src/shared/label-util.c +++ b/src/shared/label-util.c @@ -112,9 +112,9 @@ static int init_internal(bool lazy) { } int mac_init_lazy(void) { - return init_internal(/* lazy= */ true); + return init_internal(/* lazy=*/ true); } int mac_init(void) { - return init_internal(/* lazy= */ false); + return init_internal(/* lazy=*/ false); } diff --git a/src/shared/local-addresses.c b/src/shared/local-addresses.c index c1c07c9c5ff..35b99c2aa03 100644 --- a/src/shared/local-addresses.c +++ b/src/shared/local-addresses.c @@ -115,8 +115,8 @@ int add_local_address( return add_local_address_full( list, n_list, ifindex, - scope, /* priority= */ 0, /* weight= */ 0, - family, address, /* prefsrc= */ NULL); + scope, /* priority = */ 0, /* weight = */ 0, + family, address, /* prefsrc = */ NULL); } int local_addresses( @@ -246,7 +246,7 @@ static int add_local_gateway( return add_local_address_full( list, n_list, ifindex, - /* scope= */ 0, priority, weight, + /* scope = */ 0, priority, weight, family, address, prefsrc); } @@ -306,7 +306,7 @@ static int parse_nexthop_one( r = add_local_gateway(list, n_list, rtnh->rtnh_ifindex, priority, rtnh->rtnh_hops, via->family, &(union in_addr_union) { .in6 = via->address.in6 }, - /* prefsrc= */ NULL); + /* prefsrc = */ NULL); if (r < 0) return r; @@ -495,7 +495,7 @@ int local_gateways( /* Ignore prefsrc, and let's take the source address by socket command, if necessary. */ r = add_local_gateway(&list, &n_list, ifi, priority, 0, via.family, &(union in_addr_union) { .in6 = via.address.in6 }, - /* prefsrc= */ NULL); + /* prefsrc = */ NULL); if (r < 0) return r; } @@ -534,8 +534,8 @@ static int add_local_outbound( return add_local_address_full( list, n_list, ifindex, - /* scope= */ 0, /* priority= */ 0, /* weight= */ 0, - family, address, /* prefsrc= */ NULL); + /* scope = */ 0, /* priority = */ 0, /* weight = */ 0, + family, address, /* prefsrc = */ NULL); } static int add_local_outbound_by_prefsrc( diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index b01cb67acd6..95ebca25bc9 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -1985,10 +1985,10 @@ static int set_matches_for_discover_id( return add_matches_for_invocation_id(j, id); if (type == LOG_SYSTEM_UNIT_INVOCATION_ID) - return add_matches_for_unit_full(j, /* flags= */ 0, unit); + return add_matches_for_unit_full(j, /* flags = */ 0, unit); if (type == LOG_USER_UNIT_INVOCATION_ID) - return add_matches_for_user_unit_full(j, /* flags= */ 0, unit); + return add_matches_for_user_unit_full(j, /* flags = */ 0, unit); return -EINVAL; } diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h index e9f537681c8..ecf6bf2859d 100644 --- a/src/shared/logs-show.h +++ b/src/shared/logs-show.h @@ -106,7 +106,7 @@ static inline int journal_find_boot( sd_id128_t *ret) { return journal_find_log_id(j, LOG_BOOT_ID, - /* boot_id= */ SD_ID128_NULL, /* unit= */ NULL, + /* boot_id = */ SD_ID128_NULL, /* unit = */ NULL, id, offset, ret); } @@ -128,7 +128,7 @@ static inline int journal_get_boots( size_t *ret_n_ids) { return journal_get_log_ids(j, LOG_BOOT_ID, - /* boot_id= */ SD_ID128_NULL, /* unit= */ NULL, + /* boot_id = */ SD_ID128_NULL, /* unit = */ NULL, advance_older, max_ids, ret_ids, ret_n_ids); } diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 2cf5934ff7f..e9064c29105 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -741,8 +741,8 @@ int loop_device_make_by_path_at( dir_fd == AT_FDCWD ? path : NULL, fd, open_flags, - /* offset= */ 0, - /* size= */ 0, + /* offset = */ 0, + /* size = */ 0, sector_size, loop_flags, lock_op, diff --git a/src/shared/machine-id-setup.c b/src/shared/machine-id-setup.c index 0b637757481..3fe8cc74024 100644 --- a/src/shared/machine-id-setup.c +++ b/src/shared/machine-id-setup.c @@ -260,7 +260,7 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, MachineIdSetupFlag WITH_UMASK(0022) { r = id128_write_at(run_fd, "machine-id", ID128_FORMAT_PLAIN, machine_id); if (r < 0) { - (void) unlinkat(run_fd, "machine-id", /* flags= */ 0); + (void) unlinkat(run_fd, "machine-id", /* flags = */ 0); return log_error_errno(r, "Cannot write '%s': %m", run_machine_id); } } @@ -276,7 +276,7 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, MachineIdSetupFlag r = mount_follow_verbose(LOG_ERR, run_machine_id, FORMAT_PROC_FD_PATH(fd), /* fstype= */ NULL, MS_BIND, /* options= */ NULL); if (r < 0) { if (unlink_run_machine_id) - (void) unlinkat(ASSERT_FD(run_fd), "machine-id", /* flags= */ 0); + (void) unlinkat(ASSERT_FD(run_fd), "machine-id", /* flags = */ 0); return r; } @@ -384,11 +384,11 @@ int machine_id_commit(const char *root) { etc_fd_again = safe_close(etc_fd_again); /* Return to initial namespace and proceed a lazy tmpfs unmount */ - r = namespace_enter(/* pidns_fd= */ -EBADF, + r = namespace_enter(/* pidns_fd = */ -EBADF, initial_mntns_fd, - /* netns_fd= */ -EBADF, - /* userns_fd= */ -EBADF, - /* root_fd= */ -EBADF); + /* netns_fd = */ -EBADF, + /* userns_fd = */ -EBADF, + /* root_fd = */ -EBADF); if (r < 0) return log_warning_errno(r, "Failed to switch back to initial mount namespace: %m.\n" diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index c9dd431795f..455c627ff6b 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -113,7 +113,7 @@ static int do_mcopy(const char *node, const char *root) { assert(root); /* Return early if there's nothing to copy. */ - if (dir_is_empty(root, /* ignore_hidden_or_backup= */ false)) + if (dir_is_empty(root, /*ignore_hidden_or_backup=*/ false)) return 0; r = find_executable("mcopy", &mcopy); @@ -686,17 +686,17 @@ int make_filesystem( r = safe_fork_full( "(mkfs)", stdio_fds, - /* except_fds= */ NULL, - /* n_except_fds= */ 0, + /*except_fds=*/ NULL, + /*n_except_fds=*/ 0, fork_flags, - /* ret_pid= */ NULL); + /*ret_pid=*/ NULL); if (r < 0) return r; if (r == 0) { /* Child */ STRV_FOREACH_PAIR(k, v, env) - if (setenv(*k, *v, /* replace= */ true) < 0) { + if (setenv(*k, *v, /* replace = */ true) < 0) { log_error_errno(r, "Failed to set %s=%s environment variable: %m", *k, *v); _exit(EXIT_FAILURE); } diff --git a/src/shared/module-util.c b/src/shared/module-util.c index a7f9e178e3c..25367c4da67 100644 --- a/src/shared/module-util.c +++ b/src/shared/module-util.c @@ -59,7 +59,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (proc_cmdline_value_missing(key, value)) return 0; - r = strv_split_and_extend(denylist, value, ",", /* filter_duplicates= */ true); + r = strv_split_and_extend(denylist, value, ",", /* filter_duplicates = */ true); if (r < 0) return r; } diff --git a/src/shared/mount-setup.c b/src/shared/mount-setup.c index b044c16195a..cbd3e1d1076 100644 --- a/src/shared/mount-setup.c +++ b/src/shared/mount-setup.c @@ -51,7 +51,7 @@ static int cgroupfs_mount_options(int priority, const char *type, char **ret) { _cleanup_free_ char *opts = NULL; FOREACH_STRING(o, "memory_recursiveprot", "memory_hugetlb_accounting") { - r = mount_option_supported("cgroup2", o, /* value= */ NULL); + r = mount_option_supported("cgroup2", o, /* value = */ NULL); if (r < 0) log_full_errno(priority, r, "Failed to determine whether cgroupfs supports '%s' mount option, assuming not: %m", o); else if (r == 0) @@ -291,7 +291,7 @@ static int mount_one(const MountPoint *p, bool relabel) { if (relabel) (void) label_fix(p->where, LABEL_IGNORE_ENOENT|LABEL_IGNORE_EROFS); - r = path_is_mount_point_full(p->where, /* root= */ NULL, AT_SYMLINK_FOLLOW); + r = path_is_mount_point_full(p->where, /* root = */ NULL, AT_SYMLINK_FOLLOW); if (r < 0 && r != -ENOENT) { log_full_errno(priority, r, "Failed to determine whether %s is a mount point: %m", p->where); return FLAGS_SET(p->mode, MNT_FATAL) ? r : 0; diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index ca383f68ba4..555a37b9935 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -9,7 +9,6 @@ #include "alloc-util.h" #include "chase.h" -#include "creds-util.h" #include "dissect-image.h" #include "errno-util.h" #include "extract-word.h" @@ -850,8 +849,8 @@ int mount_exchange_graceful(int fsmount_fd, const char *dest, bool mount_beneath * this is not supported (minimum kernel v6.5), or if there is no mount on the mountpoint, we get * -EINVAL and then we fallback to normal mounting. */ - r = RET_NERRNO(move_mount(fsmount_fd, /* from_path= */ "", - /* to_fd= */ -EBADF, dest, + r = RET_NERRNO(move_mount(fsmount_fd, /* from_path = */ "", + /* to_fd = */ -EBADF, dest, MOVE_MOUNT_F_EMPTY_PATH | (mount_beneath ? MOVE_MOUNT_BENEATH : 0))); if (mount_beneath) { if (r >= 0) /* Mounting beneath worked! Now unmount the upper mount. */ @@ -861,7 +860,7 @@ int mount_exchange_graceful(int fsmount_fd, const char *dest, bool mount_beneath log_debug_errno(r, "Cannot mount beneath '%s', falling back to overmount: %m", dest); - return mount_exchange_graceful(fsmount_fd, dest, /* mount_beneath= */ false); + return mount_exchange_graceful(fsmount_fd, dest, /* mount_beneath = */ false); } } @@ -1203,7 +1202,7 @@ static int mount_in_namespace( if (!pidref_is_set(target)) return -ESRCH; - r = pidref_namespace_open(target, &pidns_fd, &mntns_fd, /* ret_netns_fd= */ NULL, /* ret_userns_fd= */ NULL, &root_fd); + r = pidref_namespace_open(target, &pidns_fd, &mntns_fd, /* ret_netns_fd = */ NULL, /* ret_userns_fd = */ NULL, &root_fd); if (r < 0) return log_debug_errno(r, "Failed to retrieve FDs of the target process' namespace: %m"); @@ -1362,8 +1361,8 @@ int bind_mount_in_namespace( src, dest, flags & ~MOUNT_IN_NAMESPACE_IS_IMAGE, - /* options= */ NULL, - /* image_policy= */ NULL); + /* options = */ NULL, + /* image_policy = */ NULL); } int mount_image_in_namespace( @@ -1798,7 +1797,7 @@ int get_sub_mounts(const char *prefix, SubMount **ret_mounts, size_t *ret_n_moun assert(ret_mounts); assert(ret_n_mounts); - r = libmount_parse_mountinfo(/* source= */ NULL, &table, &iter); + r = libmount_parse_mountinfo(/* source = */ NULL, &table, &iter); if (r < 0) return log_debug_errno(r, "Failed to parse /proc/self/mountinfo: %m"); @@ -1959,65 +1958,58 @@ unsigned long credentials_fs_mount_flags(bool ro) { return MS_NODEV|MS_NOEXEC|MS_NOSUID|ms_nosymfollow_supported()|(ro ? MS_RDONLY : 0); } -int fsmount_credentials_fs(int *ret_fsfd) { - _cleanup_close_ int fs_fd = -EBADF; - char size_str[DECIMAL_STR_MAX(uint64_t)]; +int mount_credentials_fs(const char *path, size_t size, bool ro) { + _cleanup_free_ char *opts = NULL; + int r, noswap_supported; /* Mounts a file system we can place credentials in, i.e. with tight access modes right from the * beginning, and ideally swapping turned off. In order of preference: * - * 1. tmpfs if it supports "noswap" (needs kernel >= 6.3) + * 1. tmpfs if it supports "noswap" * 2. ramfs - * 3. tmpfs without "noswap" + * 3. tmpfs if it doesn't support "noswap" */ - fs_fd = fsopen("tmpfs", FSOPEN_CLOEXEC); - if (fs_fd < 0) - return -errno; - - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "nr_inodes", "1024", 0) < 0) - return -errno; + noswap_supported = mount_option_supported("tmpfs", "noswap", NULL); /* Check explicitly to avoid kmsg noise */ + if (noswap_supported > 0) { + _cleanup_free_ char *noswap_opts = NULL; - xsprintf(size_str, "%" PRIu64, CREDENTIALS_TOTAL_SIZE_MAX); - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "size", size_str, 0) < 0) - return -errno; + if (asprintf(&noswap_opts, "mode=0700,nr_inodes=1024,size=%zu,noswap", size) < 0) + return -ENOMEM; - if (fsconfig(fs_fd, FSCONFIG_SET_FLAG, "noswap", NULL, 0) < 0) { - if (errno != EINVAL) - return -errno; + /* Best case: tmpfs with noswap (needs kernel >= 6.3) */ - int ramfs_fd = fsopen("ramfs", FSOPEN_CLOEXEC); - if (ramfs_fd >= 0) - close_and_replace(fs_fd, ramfs_fd); + r = mount_nofollow_verbose( + LOG_DEBUG, + "tmpfs", + path, + "tmpfs", + credentials_fs_mount_flags(ro), + noswap_opts); + if (r >= 0) + return r; } - if (fsconfig(fs_fd, FSCONFIG_SET_STRING, "mode", "0700", 0) < 0) - return -errno; - - if (fsconfig(fs_fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0) < 0) - return -errno; - - int mfd = fsmount(fs_fd, FSMOUNT_CLOEXEC, - ms_flags_to_mount_attr(credentials_fs_mount_flags(/* ro= */ false))); - if (mfd < 0) - return -errno; - - if (ret_fsfd) - *ret_fsfd = TAKE_FD(fs_fd); - - return mfd; -} - -int mount_credentials_fs(const char *path) { - _cleanup_close_ int mfd = -EBADF; - - assert(path); + r = mount_nofollow_verbose( + LOG_DEBUG, + "ramfs", + path, + "ramfs", + credentials_fs_mount_flags(ro), + "mode=0700"); + if (r >= 0) + return r; - mfd = fsmount_credentials_fs(/* ret_fsfd= */ NULL); - if (mfd < 0) - return mfd; + if (asprintf(&opts, "mode=0700,nr_inodes=1024,size=%zu", size) < 0) + return -ENOMEM; - return RET_NERRNO(move_mount(mfd, "", AT_FDCWD, path, MOVE_MOUNT_F_EMPTY_PATH)); + return mount_nofollow_verbose( + LOG_DEBUG, + "tmpfs", + path, + "tmpfs", + credentials_fs_mount_flags(ro), + opts); } int make_fsmount( @@ -2158,7 +2150,7 @@ int path_get_mount_info_at( if (ret_options) r = libmount_parse_with_utab(&table, &iter); else - r = libmount_parse_mountinfo(/* source= */ NULL, &table, &iter); + r = libmount_parse_mountinfo(/* source = */ NULL, &table, &iter); if (r < 0) return log_debug_errno(r, "Failed to parse /proc/self/mountinfo: %m"); @@ -2225,7 +2217,7 @@ int path_is_network_fs_harder_at(int dir_fd, const char *path) { return r; _cleanup_free_ char *fstype = NULL, *options = NULL; - r = path_get_mount_info_at(fd, /* path= */ NULL, &fstype, &options, /* ret_source= */ NULL); + r = path_get_mount_info_at(fd, /* path = */ NULL, &fstype, &options, /* ret_source = */ NULL); if (r < 0) return r; diff --git a/src/shared/mount-util.h b/src/shared/mount-util.h index 8d907988ebc..a10cb5b4937 100644 --- a/src/shared/mount-util.h +++ b/src/shared/mount-util.h @@ -167,8 +167,7 @@ int make_mount_point_inode_from_path(const char *source, const char *dest, mode_ int trigger_automount_at(int dir_fd, const char *path); unsigned long credentials_fs_mount_flags(bool ro); -int fsmount_credentials_fs(int *ret_fsfd); -int mount_credentials_fs(const char *path); +int mount_credentials_fs(const char *path, size_t size, bool ro); int make_fsmount(int error_log_level, const char *what, const char *type, unsigned long flags, const char *options, int userns_fd); diff --git a/src/shared/openssl-util.c b/src/shared/openssl-util.c index 31d1347f7d4..70779aa9860 100644 --- a/src/shared/openssl-util.c +++ b/src/shared/openssl-util.c @@ -1415,8 +1415,8 @@ static int load_key_from_provider( _cleanup_(OSSL_STORE_closep) OSSL_STORE_CTX *store = OSSL_STORE_open( private_key_uri, - /* ui_method= */ NULL, - /* ui_method= */ NULL, + /*ui_method=*/ NULL, + /*ui_method=*/ NULL, /* post_process= */ NULL, /* post_process_data= */ NULL); if (!store) @@ -1455,7 +1455,7 @@ static int load_key_from_engine(const char *engine, const char *private_key_uri, if (ENGINE_init(e) == 0) return log_openssl_errors("Failed to initialize signing engine '%s'", engine); - _cleanup_(EVP_PKEY_freep) EVP_PKEY *private_key = ENGINE_load_private_key(e, private_key_uri, /* ui_method= */ NULL, /* callback_data= */ NULL); + _cleanup_(EVP_PKEY_freep) EVP_PKEY *private_key = ENGINE_load_private_key(e, private_key_uri, /*ui_method=*/ NULL, /*callback_data=*/ NULL); if (!private_key) return log_openssl_errors("Failed to load private key from '%s'", private_key_uri); REENABLE_WARNING; @@ -1619,8 +1619,8 @@ static int load_x509_certificate_from_provider(const char *provider, const char _cleanup_(OSSL_STORE_closep) OSSL_STORE_CTX *store = OSSL_STORE_open( certificate_uri, - /* ui_method= */ NULL, - /* ui_method= */ NULL, + /*ui_method=*/ NULL, + /*ui_method=*/ NULL, /* post_process= */ NULL, /* post_process_data= */ NULL); if (!store) diff --git a/src/shared/parse-helpers.c b/src/shared/parse-helpers.c index 8a61f2e6699..c6ee92afc56 100644 --- a/src/shared/parse-helpers.c +++ b/src/shared/parse-helpers.c @@ -143,7 +143,7 @@ static int parse_ip_ports_token( *nr_ports = *port_min = 0; else { uint16_t mn = 0, mx = 0; - r = parse_ip_port_range(token, &mn, &mx, /* allow_zero= */ true); + r = parse_ip_port_range(token, &mn, &mx, /* allow_zero = */ true); if (r < 0) return r; diff --git a/src/shared/password-quality-util-passwdqc.c b/src/shared/password-quality-util-passwdqc.c index 31b84c6a0f9..c24c763967f 100644 --- a/src/shared/password-quality-util-passwdqc.c +++ b/src/shared/password-quality-util-passwdqc.c @@ -117,7 +117,7 @@ int check_password_quality( check_reason = sym_passwdqc_check(¶ms->qc, password, old, &pw); } else - check_reason = sym_passwdqc_check(¶ms->qc, password, old, /* pw= */ NULL); + check_reason = sym_passwdqc_check(¶ms->qc, password, old, /* pw = */ NULL); if (check_reason) { if (ret_error) { diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c index 36f552960b7..dab8761d2ec 100644 --- a/src/shared/pretty-print.c +++ b/src/shared/pretty-print.c @@ -325,7 +325,7 @@ static int cat_file_by_path(const char *p, bool *newline, CatFlags flags) { assert(p); - r = conf_file_new(p, /* root= */ NULL, CHASE_MUST_BE_REGULAR, &c); + r = conf_file_new(p, /* root = */ NULL, CHASE_MUST_BE_REGULAR, &c); if (r < 0) return log_error_errno(r, "Failed to chase '%s': %m", p); diff --git a/src/shared/reread-partition-table.c b/src/shared/reread-partition-table.c index 543482d4409..35002881890 100644 --- a/src/shared/reread-partition-table.c +++ b/src/shared/reread-partition-table.c @@ -183,7 +183,7 @@ static int process_partition( if (r < 0) return log_device_debug_errno(d, r, "Failed to remove kernel partition device '%s' in order to recreate it: %m", subnode); - /* And now add it the partition anew */ + /* And now add it the partition anew*/ log_device_debug(d, "Successfully removed kernel partition device '%s' in order to recreate it.", subnode); } diff --git a/src/shared/rm-rf.c b/src/shared/rm-rf.c index f375d25428c..9d917e95971 100644 --- a/src/shared/rm-rf.c +++ b/src/shared/rm-rf.c @@ -72,7 +72,7 @@ int unlinkat_harder(int dfd, const char *filename, int unlink_flags, RemoveFlags if (errno != EACCES || !FLAGS_SET(remove_flags, REMOVE_CHMOD)) return -errno; - r = patch_dirfd_mode(dfd, /* refuse_already_set= */ true, &old_mode); + r = patch_dirfd_mode(dfd, /* refuse_already_set = */ true, &old_mode); if (r < 0) return r; @@ -107,7 +107,7 @@ int fstatat_harder(int dfd, if (errno != EACCES || !FLAGS_SET(remove_flags, REMOVE_CHMOD)) return -errno; - r = patch_dirfd_mode(dfd, /* refuse_already_set= */ true, &old_mode); + r = patch_dirfd_mode(dfd, /* refuse_already_set = */ true, &old_mode); if (r < 0) return r; @@ -159,7 +159,7 @@ static int openat_harder(int dfd, const char *path, int open_flags, RemoveFlags return pfd; if (FLAGS_SET(remove_flags, REMOVE_CHMOD)) { - r = patch_dirfd_mode(pfd, /* refuse_already_set= */ false, &old_mode); + r = patch_dirfd_mode(pfd, /* refuse_already_set = */ false, &old_mode); if (r < 0) return r; diff --git a/src/shared/serialize.c b/src/shared/serialize.c index ab19689aec4..8aa64773000 100644 --- a/src/shared/serialize.c +++ b/src/shared/serialize.c @@ -515,7 +515,7 @@ int deserialize_pidref(FDSet *fds, const char *value, PidRef *ret) { _cleanup_free_ char *fdstr = NULL, *pidstr = NULL; _cleanup_close_ int fd = -EBADF; - r = extract_many_words(&e, ":", /* flags= */ 0, &fdstr, &pidstr); + r = extract_many_words(&e, ":", /* flags = */ 0, &fdstr, &pidstr); if (r < 0) return log_debug_errno(r, "Failed to deserialize pidref '%s': %m", e); if (r == 0) diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index 270aa18aa7f..3f4aede5371 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -301,7 +301,7 @@ static int s2h_supported(const SleepConfig *sleep_config, SleepSupport *ret_supp } FOREACH_ELEMENT(i, operations) { - r = sleep_supported_internal(sleep_config, *i, /* check_allowed= */ false, &support); + r = sleep_supported_internal(sleep_config, *i, /* check_allowed = */ false, &support); if (r < 0) return r; if (r == 0) { @@ -415,7 +415,7 @@ int sleep_supported_full(SleepOperation operation, SleepSupport *ret_support) { if (r < 0) return r; - r = sleep_supported_internal(sleep_config, operation, /* check_allowed= */ true, &support); + r = sleep_supported_internal(sleep_config, operation, /* check_allowed = */ true, &support); if (r < 0) return r; diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c index 6faec02a9f8..cf157fa6e77 100644 --- a/src/shared/smack-util.c +++ b/src/shared/smack-util.c @@ -64,7 +64,7 @@ int mac_smack_read_at(int fd, const char *path, SmackAttr attr, char **ret) { return 0; } - return getxattr_at_malloc(fd, path, smack_attr_to_string(attr), /* at_flags= */ 0, ret, /* ret_size= */ NULL); + return getxattr_at_malloc(fd, path, smack_attr_to_string(attr), /* at_flags = */ 0, ret, /* ret_size= */ NULL); #else return -EOPNOTSUPP; #endif @@ -79,9 +79,9 @@ int mac_smack_apply_at(int fd, const char *path, SmackAttr attr, const char *lab return 0; if (!label) - return xremovexattr(fd, path, /* at_flags= */ 0, smack_attr_to_string(attr)); + return xremovexattr(fd, path, /* at_flags = */ 0, smack_attr_to_string(attr)); - return xsetxattr(fd, path, /* at_flags= */ 0, smack_attr_to_string(attr), label); + return xsetxattr(fd, path, /* at_flags = */ 0, smack_attr_to_string(attr), label); #else return 0; #endif @@ -142,7 +142,7 @@ static int smack_fix_fd( else return 0; - r = xsetxattr(fd, /* path= */ NULL, AT_EMPTY_PATH, "security.SMACK64", label); + r = xsetxattr(fd, /* path = */ NULL, AT_EMPTY_PATH, "security.SMACK64", label); if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) /* If the FS doesn't support labels, then exit without warning */ return 0; if (r == -EROFS && FLAGS_SET(flags, LABEL_IGNORE_EROFS)) /* If the FS is read-only and we were told diff --git a/src/shared/smbios11.c b/src/shared/smbios11.c index 10b87e34110..528644afbc2 100644 --- a/src/shared/smbios11.c +++ b/src/shared/smbios11.c @@ -38,10 +38,10 @@ int read_smbios11_field(unsigned i, size_t max_size, char **ret_data, size_t *re * file. Since the SMBIOS data is immutable after boot, it's safe to use read_full_file_full() here. */ r = read_full_file_full( AT_FDCWD, p, - /* offset= */ UINT64_MAX, + /* offset = */ UINT64_MAX, size_add(offsetof(struct dmi_field_header, contents), max_size), - /* flags= */ 0, - /* bind_name= */ NULL, + /* flags = */ 0, + /* bind_name = */ NULL, (char**) &data, &size); if (r < 0) return r; diff --git a/src/shared/tests.c b/src/shared/tests.c index c851278d068..7aa27a88b6b 100644 --- a/src/shared/tests.c +++ b/src/shared/tests.c @@ -39,7 +39,7 @@ char* setup_fake_runtime_dir(void) { char *t; ASSERT_OK(mkdtemp_malloc("/tmp/fake-xdg-runtime-XXXXXX", &t)); - ASSERT_OK(setenv("XDG_RUNTIME_DIR", t, /* overwrite= */ true)); + ASSERT_OK(setenv("XDG_RUNTIME_DIR", t, /* overwrite = */ true)); return t; } @@ -64,7 +64,7 @@ static void load_testdata_env(void) { } STRV_FOREACH_PAIR(k, v, pairs) - ASSERT_OK(setenv(*k, *v, /* overwrite= */ false)); + ASSERT_OK(setenv(*k, *v, /* overwrite = */ false)); } int get_testdata_dir(const char *suffix, char **ret) { @@ -146,7 +146,7 @@ bool have_namespaces(void) { /* Checks whether namespaces are available. In some cases they aren't. We do this by calling unshare(), and we * do so in a child process in order not to affect our own process. */ - ASSERT_OK(r = pidref_safe_fork("(have_namespace)", /* flags= */ 0, &pid)); + ASSERT_OK(r = pidref_safe_fork("(have_namespace)", /* flags = */ 0, &pid)); if (r == 0) { /* child */ if (detach_mount_namespace() < 0) @@ -155,7 +155,7 @@ bool have_namespaces(void) { _exit(EXIT_SUCCESS); } - ASSERT_OK(r = pidref_wait_for_terminate_and_check("(have_namespace)", &pid, /* flags= */ 0)); + ASSERT_OK(r = pidref_wait_for_terminate_and_check("(have_namespace)", &pid, /* flags = */ 0)); if (r == EXIT_SUCCESS) return true; diff --git a/src/shared/tests.h b/src/shared/tests.h index 52e26dc15bf..82c186b32b7 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -7,8 +7,8 @@ #include "shared-forward.h" #include "log.h" #include "log-assert-critical.h" -#include "static-destruct.h" /* IWYU pragma: keep */ -#include "signal-util.h" /* IWYU pragma: keep */ +#include "static-destruct.h" /* IWYU pragma: keep*/ +#include "signal-util.h" /* IWYU pragma: keep*/ #include "stdio-util.h" #include "string-util.h" /* IWYU pragma: keep */ diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index e089cfbc5ea..50fda0a96a4 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -7017,7 +7017,7 @@ static int tpm2_nvpcr_write_anchor_secret_to_boot(const struct iovec *credential /* root= */ NULL, /* conf_root= */ NULL, machine_id, - /* machine_id_is_random= */ false, + /* machine_id_is_random = */ false, &entry_token_type, &entry_token); if (r < 0) @@ -8062,7 +8062,7 @@ int tpm2_pcrlock_policy_load( r = sd_json_parse_file( f, discovered_path, - /* flags= */ 0, + /* flags = */ 0, &v, /* reterr_line= */ NULL, /* ret_column= */ NULL); diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index f6021de5695..c63b956deaf 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -28,10 +28,10 @@ int udev_parse_config_full(const ConfigTableItem config_table[]) { r = config_parse_standard_file_with_dropins( "udev/udev.conf", - /* sections= */ NULL, + /* sections = */ NULL, config_item_table_lookup, config_table, CONFIG_PARSE_WARN, - /* userdata= */ NULL); + /* userdata = */ NULL); if (r == -ENOENT) return 0; return r; diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c index c5f35dba169..b0d46d388a0 100644 --- a/src/shared/unit-file.c +++ b/src/shared/unit-file.c @@ -499,7 +499,7 @@ int unit_file_build_name_map( continue; } - r = is_dir(target, /* follow= */ true); + r = is_dir(target, /* follow = */ true); if (r <= 0) continue; diff --git a/src/shared/user-record.c b/src/shared/user-record.c index 6bb174b9cac..127327bbaee 100644 --- a/src/shared/user-record.c +++ b/src/shared/user-record.c @@ -629,7 +629,7 @@ int json_dispatch_user_group_list(const char *name, sd_json_variant *variant, sd return json_log(e, flags, r, "Failed to append array element: %m"); } - r = strv_extend_strv_consume(list, TAKE_PTR(l), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(list, TAKE_PTR(l), /* filter_duplicates = */ true); if (r < 0) return json_log(variant, flags, r, "Failed to merge user/group arrays: %m"); diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 4fa6f16fcdd..3bfe4790888 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -308,7 +308,7 @@ static int execute( if (!action) action = sleep_operation_to_string(operation); - if (setenv("SYSTEMD_SLEEP_ACTION", action, /* overwrite= */ 1) < 0) + if (setenv("SYSTEMD_SLEEP_ACTION", action, /* overwrite = */ 1) < 0) log_warning_errno(errno, "Failed to set SYSTEMD_SLEEP_ACTION=%s, ignoring: %m", action); (void) execute_directories( diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 71172326da1..d15f82d61b4 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -121,7 +121,7 @@ static void context_reset_timer(Context *context) { r = event_reset_time_relative( context->event, &context->idle_time, CLOCK_MONOTONIC, arg_exit_idle_time, 0, idle_time_cb, context, - SD_EVENT_PRIORITY_NORMAL, "idle-timer", /* force_reset= */ true); + SD_EVENT_PRIORITY_NORMAL, "idle-timer", /* force_reset = */ true); if (r < 0) log_warning_errno(r, "Failed to reset idle timer, ignoring: %m"); } diff --git a/src/sulogin-shell/sulogin-shell.c b/src/sulogin-shell/sulogin-shell.c index 5d691d3d472..2e9380d8fec 100644 --- a/src/sulogin-shell/sulogin-shell.c +++ b/src/sulogin-shell/sulogin-shell.c @@ -108,7 +108,7 @@ static int run(int argc, char *argv[]) { /* We look the argument in the kernel cmdline under the same name as the environment variable * to express that this is not supported at the same level as the regular kernel cmdline * switches. */ - r = proc_cmdline_get_bool("SYSTEMD_SULOGIN_FORCE", /* flags= */ 0, &force); + r = proc_cmdline_get_bool("SYSTEMD_SULOGIN_FORCE", /* flags = */ 0, &force); if (r < 0) log_debug_errno(r, "Failed to parse SYSTEMD_SULOGIN_FORCE from kernel command line, ignoring: %m"); } diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 912e18a95c0..bc70509cab1 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -138,8 +138,8 @@ static int apply_glob_option_with_prefix(OrderedHashmap *sysctl_options, Option } return sysctl_write_or_warn(key, option->value, - /* ignore_failure= */ option->ignore_failure, - /* ignore_enoent= */ true); + /* ignore_failure = */ option->ignore_failure, + /* ignore_enoent = */ true); } pattern = path_join("/proc/sys", key); @@ -172,8 +172,8 @@ static int apply_glob_option_with_prefix(OrderedHashmap *sysctl_options, Option RET_GATHER(r, sysctl_write_or_warn(key, option->value, - /* ignore_failure= */ option->ignore_failure, - /* ignore_enoent= */ !arg_strict)); + /* ignore_failure = */ option->ignore_failure, + /* ignore_enoent = */ !arg_strict)); } return r; @@ -205,8 +205,8 @@ static int apply_all(OrderedHashmap *sysctl_options) { k = apply_glob_option(sysctl_options, option); else k = sysctl_write_or_warn(option->key, option->value, - /* ignore_failure= */ option->ignore_failure, - /* ignore_enoent= */ !arg_strict); + /* ignore_failure = */ option->ignore_failure, + /* ignore_enoent = */ !arg_strict); RET_GATHER(r, k); } @@ -279,13 +279,13 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool static int parse_file(OrderedHashmap **sysctl_options, const char *path, bool ignore_enoent) { return conf_file_read( - /* root= */ NULL, + /* root = */ NULL, (const char**) CONF_PATHS_STRV("sysctl.d"), path, parse_line, sysctl_options, ignore_enoent, - /* invalid_config= */ NULL); + /* invalid_config = */ NULL); } static int read_credential_lines(OrderedHashmap **sysctl_options) { @@ -454,7 +454,7 @@ static int run(int argc, char *argv[]) { STRV_FOREACH(arg, strv_skip(argv, optind)) { if (arg_inline) /* Use (argument):n, where n==1 for the first positional arg */ - RET_GATHER(r, parse_line("(argument)", ++pos, *arg, /* invalid_config= */ NULL, &sysctl_options)); + RET_GATHER(r, parse_line("(argument)", ++pos, *arg, /* invalid_config = */ NULL, &sysctl_options)); else RET_GATHER(r, parse_file(&sysctl_options, *arg, false)); } diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 2f6bee58c46..d18f1389370 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -187,9 +187,9 @@ static int parse_config_file(ImageClass image_class) { sections, config_item_table_lookup, items, CONFIG_PARSE_WARN, - /* userdata= */ NULL, - /* ret_stats_by_path= */ NULL, - /* ret_dropin_files= */ NULL); + /* userdata = */ NULL, + /* ret_stats_by_path = */ NULL, + /* ret_dropin_files = */ NULL); if (r < 0) return r; @@ -313,7 +313,7 @@ static int need_reload( const char *extension_reload_manager = NULL; int b; - r = load_extension_release_pairs(arg_root, image_class, *extension, /* relax_extension_release_check= */ true, &extension_release); + r = load_extension_release_pairs(arg_root, image_class, *extension, /* relax_extension_release_check = */ true, &extension_release); if (r < 0) { log_debug_errno(r, "Failed to parse extension-release metadata of %s, ignoring: %m", *extension); continue; diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c index 2903d76929e..c760b917f62 100644 --- a/src/systemctl/systemctl-enable.c +++ b/src/systemctl/systemctl-enable.c @@ -405,7 +405,7 @@ int verb_enable(int argc, char *argv[], void *userdata) { assert(!STR_IN_SET(start_verb, "start", "restart")); - r = unit_name_replace_instance_full(unit_name, "*", /* accept_glob= */ true, &globbed); + r = unit_name_replace_instance_full(unit_name, "*", /* accept_glob = */ true, &globbed); if (r < 0) return log_error_errno(r, "Failed to glob unit name '%s': %m", unit_name); diff --git a/src/systemctl/systemctl-list-dependencies.c b/src/systemctl/systemctl-list-dependencies.c index 65f12ea4739..5fdd442e880 100644 --- a/src/systemctl/systemctl-list-dependencies.c +++ b/src/systemctl/systemctl-list-dependencies.c @@ -144,7 +144,7 @@ static int list_dependencies_one( continue; } - r = list_dependencies_print(*c, active_state, level, branches, /* last= */ c[1] == NULL && !circular); + r = list_dependencies_print(*c, active_state, level, branches, /* last = */ c[1] == NULL && !circular); if (r < 0) return r; @@ -156,7 +156,7 @@ static int list_dependencies_one( } if (circular && !arg_plain) { - r = list_dependencies_print("...", _UNIT_ACTIVE_STATE_INVALID, level, branches, /* last= */ true); + r = list_dependencies_print("...", _UNIT_ACTIVE_STATE_INVALID, level, branches, /* last = */ true); if (r < 0) return r; } diff --git a/src/systemctl/systemctl-logind.c b/src/systemctl/systemctl-logind.c index 4638cd8680d..42eefabcbbf 100644 --- a/src/systemctl/systemctl-logind.c +++ b/src/systemctl/systemctl-logind.c @@ -76,7 +76,7 @@ int logind_reboot(enum action a) { if (!actions[a]) return -EINVAL; - r = acquire_bus_full(BUS_FULL, /* graceful= */ true, &bus); + r = acquire_bus_full(BUS_FULL, /* graceful = */ true, &bus); if (r < 0) return r; @@ -167,7 +167,7 @@ int logind_check_inhibitors(enum action a) { if (arg_transport != BUS_TRANSPORT_LOCAL) return 0; - r = acquire_bus_full(BUS_FULL, /* graceful= */ true, &bus); + r = acquire_bus_full(BUS_FULL, /* graceful = */ true, &bus); if ((ERRNO_IS_NEG_DISCONNECT(r) || r == -ENOENT) && geteuid() == 0) return 0; /* When D-Bus is not running (ECONNREFUSED) or D-Bus socket is not created (ENOENT), * allow root to force a shutdown. E.g. when running at the emergency console. */ diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 08319602c00..245ffdde098 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -940,7 +940,7 @@ static void print_status_info( i->id, i->log_namespace, arg_output, - /* n_columns= */ 0, + /* n_columns = */ 0, i->inactive_exit_timestamp_monotonic, arg_lines, get_output_flags() | OUTPUT_BEGIN_NEWLINE, diff --git a/src/systemctl/systemctl-start-unit.c b/src/systemctl/systemctl-start-unit.c index a6fb12d1c00..22501aa3fbc 100644 --- a/src/systemctl/systemctl-start-unit.c +++ b/src/systemctl/systemctl-start-unit.c @@ -422,7 +422,7 @@ int verb_start(int argc, char *argv[], void *userdata) { * another active unit (socket, path, timer) */ if (!arg_quiet && !arg_no_warn) STRV_FOREACH(unit, stopped_units) - warn_triggering_units(bus, *unit, "Stopping", /* ignore_masked= */ true); + warn_triggering_units(bus, *unit, "Stopping", /* ignore_masked = */ true); } if (arg_wait) { diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index ef7bce9e7f1..20bae11fa2b 100644 --- a/src/systemctl/systemctl-util.c +++ b/src/systemctl/systemctl-util.c @@ -760,7 +760,7 @@ int append_unit_dependencies(sd_bus *bus, char **names, char ***ret) { (void) unit_get_dependencies(bus, *name, &deps); - if (strv_extend_strv_consume(&with_deps, deps, /* filter_duplicates= */ true) < 0) + if (strv_extend_strv_consume(&with_deps, deps, /* filter_duplicates = */ true) < 0) return log_oom(); } diff --git a/src/systemctl/systemctl-whoami.c b/src/systemctl/systemctl-whoami.c index bf38eb2236b..64fb1d6d3aa 100644 --- a/src/systemctl/systemctl-whoami.c +++ b/src/systemctl/systemctl-whoami.c @@ -28,7 +28,7 @@ int verb_whoami(int argc, char *argv[], void *userdata) { /* Our own process can never go away while querying, hence no need to go through pidfd. */ - r = get_unit_by_pid(bus, 0, &unit, /* ret_path= */ NULL); + r = get_unit_by_pid(bus, 0, &unit, /* ret_path = */ NULL); if (r < 0) return r; @@ -44,7 +44,7 @@ int verb_whoami(int argc, char *argv[], void *userdata) { if (r < 0) return log_error_errno(r, "Invalid PID specified: %s", *pidstr); - r = lookup_unit_by_pidref(bus, pid, &unit, /* ret_path= */ NULL); + r = lookup_unit_by_pidref(bus, pid, &unit, /* ret_path = */ NULL); if (r < 0) RET_GATHER(ret, r); else diff --git a/src/systemd/sd-lldp-rx.h b/src/systemd/sd-lldp-rx.h index 4772d390c60..8a99dddfdbc 100644 --- a/src/systemd/sd-lldp-rx.h +++ b/src/systemd/sd-lldp-rx.h @@ -18,7 +18,7 @@ ***/ #include "_sd-common.h" -#include "sd-lldp.h" /* IWYU pragma: export */ +#include "sd-lldp.h" /* IWYU pragma: export*/ _SD_BEGIN_DECLARATIONS; diff --git a/src/systemd/sd-lldp-tx.h b/src/systemd/sd-lldp-tx.h index 3a9ea9d7ba1..3dfb481b555 100644 --- a/src/systemd/sd-lldp-tx.h +++ b/src/systemd/sd-lldp-tx.h @@ -19,7 +19,7 @@ #include "_sd-common.h" #include "sd-json.h" -#include "sd-lldp.h" /* IWYU pragma: export */ +#include "sd-lldp.h" /* IWYU pragma: export*/ _SD_BEGIN_DECLARATIONS; diff --git a/src/sysupdate/sysupdate-pattern.c b/src/sysupdate/sysupdate-pattern.c index 76155dcd292..27c58f6e6d3 100644 --- a/src/sysupdate/sysupdate-pattern.c +++ b/src/sysupdate/sysupdate-pattern.c @@ -406,7 +406,7 @@ int pattern_match(const char *pattern, const char *s, InstanceMetadata *ret) { if (strlen(t) != sizeof(found.sha256sum) * 2) goto nope; - r = unhexmem_full(t, sizeof(found.sha256sum) * 2, /* secure= */ false, &d, &l); + r = unhexmem_full(t, sizeof(found.sha256sum) * 2, /* secure = */ false, &d, &l); if (r == -ENOMEM) return r; if (r < 0) diff --git a/src/sysupdate/sysupdate-resource.c b/src/sysupdate/sysupdate-resource.c index 2cbc26ea539..b0fa799fd1f 100644 --- a/src/sysupdate/sysupdate-resource.c +++ b/src/sysupdate/sysupdate-resource.c @@ -402,7 +402,7 @@ static int resource_load_from_web( if (p[0] == '\\') return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "File names with escapes not supported in manifest at line %zu, refusing.", line_nr); - r = unhexmem_full(p, 64, /* secure= */ false, &h, &hlen); + r = unhexmem_full(p, 64, /* secure = */ false, &h, &hlen); if (r < 0) return log_error_errno(r, "Failed to parse digest at manifest line %zu, refusing.", line_nr); diff --git a/src/sysupdate/sysupdate-transfer.c b/src/sysupdate/sysupdate-transfer.c index d6009d5e4c1..66a4d3d5106 100644 --- a/src/sysupdate/sysupdate-transfer.c +++ b/src/sysupdate/sysupdate-transfer.c @@ -683,7 +683,7 @@ int transfer_resolve_paths( if (r < 0) return r; - r = resource_resolve_path(&t->target, root, /* relative_to_directory= */ NULL, node); + r = resource_resolve_path(&t->target, root, /*relative_to_directory=*/ NULL, node); if (r < 0) return r; diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 9816dd15b65..0e32901c178 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -974,7 +974,7 @@ static int context_on_acquire_progress(const Transfer *t, const Instance *inst, assert(overall <= 100); log_debug("Transfer %zu/%zu is %u%% complete (%u%% overall).", i+1, n, percentage, overall); - return sd_notifyf(/* unset_environment= */ false, "X_SYSUPDATE_PROGRESS=%u\n" + return sd_notifyf(/* unset_environment=*/ false, "X_SYSUPDATE_PROGRESS=%u\n" "X_SYSUPDATE_TRANSFERS_LEFT=%zu\n" "X_SYSUPDATE_TRANSFERS_DONE=%zu\n" "STATUS=Updating to '%s' (%u%% complete).", @@ -1031,7 +1031,7 @@ static int context_apply( log_info("Selected update '%s' for install.", us->version); - (void) sd_notifyf(/* unset_environment= */ false, + (void) sd_notifyf(/* unset_environment=*/ false, "READY=1\n" "X_SYSUPDATE_VERSION=%s\n" "STATUS=Making room for '%s'.", us->version, us->version); @@ -1041,15 +1041,15 @@ static int context_apply( * download succeeded already, in which case we shouldn't remove it just to acquire it again */ r = context_vacuum( c, - /* space= */ 1, - /* extra_protected_version= */ us->version); + /* space = */ 1, + /* extra_protected_version = */ us->version); if (r < 0) return r; if (arg_sync) sync(); - (void) sd_notifyf(/* unset_environment= */ false, + (void) sd_notifyf(/* unset_environment=*/ false, "STATUS=Updating to '%s'.", us->version); /* There should now be one instance picked for each transfer, and the order is the same */ @@ -1074,7 +1074,7 @@ static int context_apply( if (arg_sync) sync(); - (void) sd_notifyf(/* unset_environment= */ false, + (void) sd_notifyf(/* unset_environment=*/ false, "STATUS=Installing '%s'.", us->version); for (size_t i = 0; i < c->n_transfers; i++) { @@ -1091,7 +1091,7 @@ static int context_apply( log_info("%s Successfully installed update '%s'.", glyph(GLYPH_SPARKLES), us->version); - (void) sd_notifyf(/* unset_environment= */ false, + (void) sd_notifyf(/* unset_environment=*/ false, "STATUS=Installed '%s'.", us->version); if (ret_applied) diff --git a/src/sysupdate/sysupdated.c b/src/sysupdate/sysupdated.c index 271f49c16b3..dec7123c1e6 100644 --- a/src/sysupdate/sysupdated.c +++ b/src/sysupdate/sysupdated.c @@ -238,8 +238,8 @@ static int job_parse_child_output(int _fd, sd_json_variant **ret) { return 0; } - r = sd_json_parse_file_at(/* f= */ NULL, fd, /* path= */ NULL, /* flags= */ 0, - &v, /* reterr_line= */ NULL, /* reterr_column= */ NULL); + r = sd_json_parse_file_at(/* f = */ NULL, fd, /* path = */ NULL, /* flags = */ 0, + &v, /* reterr_line = */ NULL, /* reterr_column = */ NULL); if (r < 0) return log_debug_errno(r, "Failed to parse child output as JSON: %m"); @@ -1959,7 +1959,7 @@ static int method_list_appstream(sd_bus_message *msg, void *userdata, sd_bus_err if (r < 0) return r; - r = strv_extend_strv_consume(&urls, target_appstream, /* filter_duplicates= */ true); + r = strv_extend_strv_consume(&urls, target_appstream, /* filter_duplicates = */ true); if (r < 0) return r; } diff --git a/src/test/test-blockdev-util.c b/src/test/test-blockdev-util.c index abef98b5076..5e67487fccc 100644 --- a/src/test/test-blockdev-util.c +++ b/src/test/test-blockdev-util.c @@ -49,7 +49,7 @@ TEST(partscan_enabled) { assert_se(sd_device_enumerator_new(&e) >= 0); assert_se(sd_device_enumerator_allow_uninitialized(e) >= 0); - assert_se(sd_device_enumerator_add_match_subsystem(e, "block", /* match= */ true) >= 0); + assert_se(sd_device_enumerator_add_match_subsystem(e, "block", /* match = */ true) >= 0); FOREACH_DEVICE(e, dev) { _cleanup_close_ int fd = -EBADF; diff --git a/src/test/test-bpf-devices.c b/src/test/test-bpf-devices.c index 1cc8145a303..78e74876554 100644 --- a/src/test/test-bpf-devices.c +++ b/src/test/test-bpf-devices.c @@ -275,7 +275,7 @@ int main(int argc, char *argv[]) { if (r < 0) return log_tests_skipped_errno(r, "Failed to prepare cgroup subtree"); - r = cg_get_path(cgroup, /* suffix= */ NULL, &controller_path); + r = cg_get_path(cgroup, /* suffix = */ NULL, &controller_path); ASSERT_OK(r); _cleanup_(bpf_program_freep) BPFProgram *prog = NULL; diff --git a/src/test/test-bpf-restrict-fs.c b/src/test/test-bpf-restrict-fs.c index 9d54ad03376..8450750c196 100644 --- a/src/test/test-bpf-restrict-fs.c +++ b/src/test/test-bpf-restrict-fs.c @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) { if (!can_memlock()) return log_tests_skipped("Can't use mlock()"); - if (!bpf_restrict_fs_supported(/* initialize= */ true)) + if (!bpf_restrict_fs_supported(/* initialize = */ true)) return log_tests_skipped("LSM BPF hooks are not supported"); r = enter_cgroup_subroot(NULL); diff --git a/src/test/test-bpf-token.c b/src/test/test-bpf-token.c index f0ba50e715f..ffdf822b8b3 100644 --- a/src/test/test-bpf-token.c +++ b/src/test/test-bpf-token.c @@ -12,7 +12,7 @@ static int intro(void) { if (bpffs_fd < 0) return log_error_errno(errno, "Failed to open '/sys/fs/bpf': %m"); - _cleanup_close_ int token_fd = bpf_token_create(bpffs_fd, /* opts= */ NULL); + _cleanup_close_ int token_fd = bpf_token_create(bpffs_fd, /* opts = */ NULL); if (token_fd < 0) return log_error_errno(errno, "Failed to create bpf token: %m"); diff --git a/src/test/test-cgroup-setup.c b/src/test/test-cgroup-setup.c index 092ce939f5b..ae33e1fcd13 100644 --- a/src/test/test-cgroup-setup.c +++ b/src/test/test-cgroup-setup.c @@ -54,7 +54,7 @@ TEST(cg_create) { ASSERT_TRUE(path_equal(path, test_d)); free(path); - ASSERT_OK_ZERO(cg_get_path(test_d, /* suffix= */ NULL, &path)); + ASSERT_OK_ZERO(cg_get_path(test_d, /* suffix = */ NULL, &path)); log_debug("test_d: %s", path); ASSERT_TRUE(path_equal(path, strjoina("/sys/fs/cgroup", test_d))); free(path); diff --git a/src/test/test-compress-benchmark.c b/src/test/test-compress-benchmark.c index da68c6cb7b8..59e215122d2 100644 --- a/src/test/test-compress-benchmark.c +++ b/src/test/test-compress-benchmark.c @@ -97,7 +97,7 @@ static void test_compress_decompress(const char* label, const char* type, memzero(buf, MIN(size + 1000, MAX_SIZE)); - r = compress(text, size, buf, size, &j, /* level= */ -1); + r = compress(text, size, buf, size, &j, /* level = */ -1); /* assume compression must be successful except for small or random inputs */ assert_se(r >= 0 || (size < 2048 && r == -ENOBUFS) || streq(type, "random")); diff --git a/src/test/test-compress.c b/src/test/test-compress.c index 7b12e88adf6..01e6e9863a9 100644 --- a/src/test/test-compress.c +++ b/src/test/test-compress.c @@ -61,7 +61,7 @@ _unused_ static void test_compress_decompress( log_info("/* testing %s %s blob compression/decompression */", compression, data); - r = compress(data, data_len, compressed, sizeof(compressed), &csize, /* level= */ -1); + r = compress(data, data_len, compressed, sizeof(compressed), &csize, /* level = */ -1); if (r == -ENOBUFS) { log_info_errno(r, "compression failed: %m"); assert_se(may_fail); @@ -110,14 +110,14 @@ _unused_ static void test_decompress_startswith(const char *compression, compressed = compressed1 = malloc(BUFSIZE_1); assert_se(compressed1); - r = compress(data, data_len, compressed, BUFSIZE_1, &csize, /* level= */ -1); + r = compress(data, data_len, compressed, BUFSIZE_1, &csize, /* level = */ -1); if (r == -ENOBUFS) { log_info_errno(r, "compression failed: %m"); assert_se(may_fail); compressed = compressed2 = malloc(BUFSIZE_2); assert_se(compressed2); - r = compress(data, data_len, compressed, BUFSIZE_2, &csize, /* level= */ -1); + r = compress(data, data_len, compressed, BUFSIZE_2, &csize, /* level = */ -1); } assert_se(r >= 0); @@ -149,7 +149,7 @@ _unused_ static void test_decompress_startswith_short(const char *compression, log_info("/* %s with %s */", __func__, compression); - r = compress(TEXT, sizeof TEXT, buf, sizeof buf, &csize, /* level= */ -1); + r = compress(TEXT, sizeof TEXT, buf, sizeof buf, &csize, /* level = */ -1); assert_se(r >= 0); for (size_t i = 1; i < strlen(TEXT); i++) { diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c index a63e58015e4..1680c68368a 100644 --- a/src/test/test-conf-files.c +++ b/src/test/test-conf-files.c @@ -53,10 +53,10 @@ TEST(conf_files_list) { } ASSERT_OK(touch(strjoina(t2, "/absolute-empty.real"))); - ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/absolute-empty.real"), AT_FDCWD, strjoina(search3, "absolute-empty.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/absolute-empty.real"), AT_FDCWD, strjoina(search3, "absolute-empty.conf"), /* flags = */ 0)); ASSERT_OK(write_string_file_at(tfd2, "absolute-non-empty.real", "absolute-non-empty", WRITE_STRING_FILE_CREATE)); - ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/absolute-non-empty.real"), AT_FDCWD, strjoina(search3, "absolute-non-empty.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/absolute-non-empty.real"), AT_FDCWD, strjoina(search3, "absolute-non-empty.conf"), /* flags = */ 0)); ASSERT_OK(touch(strjoina(t2, "/relative-empty.real"))); ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/relative-empty.real"), AT_FDCWD, strjoina(search3, "relative-empty.conf"), SYMLINK_MAKE_RELATIVE)); @@ -65,16 +65,16 @@ TEST(conf_files_list) { ASSERT_OK(symlinkat_atomic_full(strjoina(t2, "/relative-non-empty.real"), AT_FDCWD, strjoina(search3, "relative-non-empty.conf"), SYMLINK_MAKE_RELATIVE)); ASSERT_OK(touch(strjoina(t, "/absolute-empty-for-root.real"))); - ASSERT_OK(symlinkat_atomic_full("/absolute-empty-for-root.real", AT_FDCWD, strjoina(search3, "absolute-empty-for-root.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full("/absolute-empty-for-root.real", AT_FDCWD, strjoina(search3, "absolute-empty-for-root.conf"), /* flags = */ 0)); ASSERT_OK(write_string_file_at(tfd, "absolute-non-empty-for-root.real", "absolute-non-empty", WRITE_STRING_FILE_CREATE)); - ASSERT_OK(symlinkat_atomic_full("/absolute-non-empty-for-root.real", AT_FDCWD, strjoina(search3, "absolute-non-empty-for-root.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full("/absolute-non-empty-for-root.real", AT_FDCWD, strjoina(search3, "absolute-non-empty-for-root.conf"), /* flags = */ 0)); ASSERT_OK(touch(strjoina(t, "/relative-empty-for-root.real"))); - ASSERT_OK(symlinkat_atomic_full("../../../../relative-empty-for-root.real", AT_FDCWD, strjoina(search3, "relative-empty-for-root.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full("../../../../relative-empty-for-root.real", AT_FDCWD, strjoina(search3, "relative-empty-for-root.conf"), /* flags = */ 0)); ASSERT_OK(write_string_file_at(tfd, "relative-non-empty-for-root.real", "relative-non-empty", WRITE_STRING_FILE_CREATE)); - ASSERT_OK(symlinkat_atomic_full("../../../../relative-non-empty-for-root.real", AT_FDCWD, strjoina(search3, "relative-non-empty-for-root.conf"), /* flags= */ 0)); + ASSERT_OK(symlinkat_atomic_full("../../../../relative-non-empty-for-root.real", AT_FDCWD, strjoina(search3, "relative-non-empty-for-root.conf"), /* flags = */ 0)); search1_a = strjoina(search1, "a.conf"); search1_b = strjoina(search1, "b.conf"); @@ -205,19 +205,19 @@ TEST(conf_files_list) { result = strv_free(result); /* search dir3 */ - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, /* root= */ NULL, CONF_FILES_FILTER_MASKED, search3)); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, /* root = */ NULL, CONF_FILES_FILTER_MASKED, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty.conf"), strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, /* root= */ NULL, CONF_FILES_FILTER_MASKED_BY_EMPTY, search3)); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, /* root = */ NULL, CONF_FILES_FILTER_MASKED_BY_EMPTY, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty.conf"), strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, /* root= */ NULL, CONF_FILES_FILTER_MASKED_BY_SYMLINK, search3)); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, /* root = */ NULL, CONF_FILES_FILTER_MASKED_BY_SYMLINK, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty.conf"), strjoina(search3, "absolute-non-empty.conf"), @@ -225,7 +225,7 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, /* root= */ NULL, CONF_FILES_REGULAR, search3)); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, /* root = */ NULL, CONF_FILES_REGULAR, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty.conf"), strjoina(search3, "absolute-non-empty.conf"), @@ -233,19 +233,19 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, t, CONF_FILES_FILTER_MASKED, "/dir3/")); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, t, CONF_FILES_FILTER_MASKED, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty-for-root.conf"), strjoina(search3, "relative-non-empty-for-root.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, t, CONF_FILES_FILTER_MASKED_BY_EMPTY, "/dir3/")); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, t, CONF_FILES_FILTER_MASKED_BY_EMPTY, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty-for-root.conf"), strjoina(search3, "relative-non-empty-for-root.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, t, CONF_FILES_FILTER_MASKED_BY_SYMLINK, "/dir3/")); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, t, CONF_FILES_FILTER_MASKED_BY_SYMLINK, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty-for-root.conf"), strjoina(search3, "absolute-non-empty-for-root.conf"), @@ -253,7 +253,7 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty-for-root.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list(&result, /* suffix= */ NULL, t, CONF_FILES_REGULAR, "/dir3/")); + ASSERT_OK(conf_files_list(&result, /* suffix = */ NULL, t, CONF_FILES_REGULAR, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty-for-root.conf"), strjoina(search3, "absolute-non-empty-for-root.conf"), @@ -261,19 +261,19 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty-for-root.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED, search3)); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty.conf"), strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED_BY_EMPTY, search3)); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED_BY_EMPTY, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-non-empty.conf"), strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED_BY_SYMLINK, search3)); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, AT_FDCWD, CONF_FILES_FILTER_MASKED_BY_SYMLINK, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty.conf"), strjoina(search3, "absolute-non-empty.conf"), @@ -281,7 +281,7 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, AT_FDCWD, CONF_FILES_REGULAR, search3)); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, AT_FDCWD, CONF_FILES_REGULAR, search3)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(strjoina(search3, "absolute-empty.conf"), strjoina(search3, "absolute-non-empty.conf"), @@ -289,19 +289,19 @@ TEST(conf_files_list) { strjoina(search3, "relative-non-empty.conf")))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, tfd, CONF_FILES_FILTER_MASKED, "/dir3/")); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, tfd, CONF_FILES_FILTER_MASKED, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE("dir3/absolute-non-empty-for-root.conf", "dir3/relative-non-empty-for-root.conf"))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, tfd, CONF_FILES_FILTER_MASKED_BY_EMPTY, "/dir3/")); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, tfd, CONF_FILES_FILTER_MASKED_BY_EMPTY, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE("dir3/absolute-non-empty-for-root.conf", "dir3/relative-non-empty-for-root.conf"))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, tfd, CONF_FILES_FILTER_MASKED_BY_SYMLINK, "/dir3/")); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, tfd, CONF_FILES_FILTER_MASKED_BY_SYMLINK, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE("dir3/absolute-empty-for-root.conf", "dir3/absolute-non-empty-for-root.conf", @@ -309,7 +309,7 @@ TEST(conf_files_list) { "dir3/relative-non-empty-for-root.conf"))); result = strv_free(result); - ASSERT_OK(conf_files_list_at(&result, /* suffix= */ NULL, tfd, CONF_FILES_REGULAR, "/dir3/")); + ASSERT_OK(conf_files_list_at(&result, /* suffix = */ NULL, tfd, CONF_FILES_REGULAR, "/dir3/")); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE("dir3/absolute-empty-for-root.conf", "dir3/absolute-non-empty-for-root.conf", @@ -344,7 +344,7 @@ TEST(conf_files_list) { /* with replacement */ _cleanup_free_ char *inserted = NULL; - ASSERT_OK(conf_files_list_with_replacement(/* root= */ NULL, STRV_MAKE(search1, search2, search3), search1_a, &result, &inserted)); + ASSERT_OK(conf_files_list_with_replacement(/* root = */ NULL, STRV_MAKE(search1, search2, search3), search1_a, &result, &inserted)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(search1_a, search2_aa, @@ -358,7 +358,7 @@ TEST(conf_files_list) { result = strv_free(result); inserted = mfree(inserted); - ASSERT_OK(conf_files_list_with_replacement(/* root= */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir1/aa.conf"), &result, &inserted)); + ASSERT_OK(conf_files_list_with_replacement(/* root = */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir1/aa.conf"), &result, &inserted)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(search1_a, strjoina(search1, "aa.conf"), @@ -372,7 +372,7 @@ TEST(conf_files_list) { result = strv_free(result); inserted = mfree(inserted); - ASSERT_OK(conf_files_list_with_replacement(/* root= */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir2/a.conf"), &result, &inserted)); + ASSERT_OK(conf_files_list_with_replacement(/* root = */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir2/a.conf"), &result, &inserted)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(search1_a, search2_aa, @@ -386,7 +386,7 @@ TEST(conf_files_list) { result = strv_free(result); inserted = mfree(inserted); - ASSERT_OK(conf_files_list_with_replacement(/* root= */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir4/a.conf"), &result, &inserted)); + ASSERT_OK(conf_files_list_with_replacement(/* root = */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir4/a.conf"), &result, &inserted)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(search1_a, search2_aa, @@ -400,7 +400,7 @@ TEST(conf_files_list) { result = strv_free(result); inserted = mfree(inserted); - ASSERT_OK(conf_files_list_with_replacement(/* root= */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir4/x.conf"), &result, &inserted)); + ASSERT_OK(conf_files_list_with_replacement(/* root = */ NULL, STRV_MAKE(search1, search2, search3), strjoina(t, "/dir4/x.conf"), &result, &inserted)); strv_print(result); ASSERT_TRUE(strv_equal(result, STRV_MAKE(search1_a, search2_aa, diff --git a/src/test/test-cpu-set-util.c b/src/test/test-cpu-set-util.c index bd22e4ddb2a..eff64606101 100644 --- a/src/test/test-cpu-set-util.c +++ b/src/test/test-cpu-set-util.c @@ -187,14 +187,14 @@ TEST(parse_cpu_set) { config_parse_cpu_set( \ "unit", \ "filename", \ - /* line= */ 0, \ + /* line = */ 0, \ "[Section]", \ - /* section_line= */ 0, \ + /* section_line = */ 0, \ "CPUAffinity", \ - /* ltype= */ 0, \ + /* ltype = */ 0, \ str, \ c, \ - /* userdata= */ NULL) + /* userdata = */ NULL) TEST(config_parse_cpu_set) { CPUSet c = {}; diff --git a/src/test/test-creds.c b/src/test/test-creds.c index 5cad6080933..384c10c70e5 100644 --- a/src/test/test-creds.c +++ b/src/test/test-creds.c @@ -134,7 +134,7 @@ static void test_encrypt_decrypt_with(sd_id128_t mode, uid_t uid) { mode, "foo", /* timestamp= */ USEC_INFINITY, - /* not_after= */ USEC_INFINITY, + /* not_after=*/ USEC_INFINITY, /* tpm2_device= */ NULL, /* tpm2_hash_pcr_mask= */ 0, /* tpm2_pubkey_path= */ NULL, diff --git a/src/test/test-exec-util.c b/src/test/test-exec-util.c index 7c3b872c10d..b07b123565f 100644 --- a/src/test/test-exec-util.c +++ b/src/test/test-exec-util.c @@ -409,8 +409,8 @@ TEST(error_catching) { r = execute_directories(__func__, dirs, DEFAULT_TIMEOUT_USEC, - /* callbacks= */ NULL, /* callback_args= */ NULL, - /* argv= */ NULL, /* envp= */ NULL, /* flags= */ 0); + /* callbacks = */ NULL, /* callback_args = */ NULL, + /* argv = */ NULL, /* envp = */ NULL, /* flags = */ 0); /* we should exit with the error code of the first script that failed */ assert_se(r == 42); diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 973387b3de8..d5b7e3416c7 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -265,7 +265,7 @@ static bool have_userns_privileges(void) { * configured to make CLONE_NEWUSER require CAP_SYS_ADMIN. * Additionally, AppArmor may restrict unprivileged user * namespace creation. */ - r = capability_bounding_set_drop(UINT64_C(1) << CAP_SYS_ADMIN, /* right_now= */ true); + r = capability_bounding_set_drop(UINT64_C(1) << CAP_SYS_ADMIN, /* right_now = */ true); if (r < 0) { log_debug_errno(r, "Failed to drop capabilities: %m"); _exit(2); @@ -1606,7 +1606,7 @@ TEST(run_tests_unprivileged) { ASSERT_NOT_NULL((filters = strv_copy(strv_skip(saved_argv, 1)))); if (prepare_ns("(test-execute-unprivileged)") == 0) { - ASSERT_OK(capability_bounding_set_drop(0, /* right_now= */ true)); + ASSERT_OK(capability_bounding_set_drop(0, /* right_now = */ true)); can_unshare = false; run_tests(RUNTIME_SCOPE_USER, filters); diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c index 7b41d98e663..aea6cded5aa 100644 --- a/src/test/test-firewall-util.c +++ b/src/test/test-firewall-util.c @@ -76,8 +76,8 @@ TEST(v4) { static int intro(void) { int r; - ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_NFT_TABLE_NAME", "io.systemd-test.nat", /* overwrite= */ true)); - ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_DNAT_MAP_NAME", "test_map_port_ipport", /* overwrite= */ true)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_NFT_TABLE_NAME", "io.systemd-test.nat", /* overwrite = */ true)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_FIREWALL_UTIL_DNAT_MAP_NAME", "test_map_port_ipport", /* overwrite = */ true)); r = sd_nfnl_socket_open(&nfnl); if (r < 0) diff --git a/src/test/test-format-table.c b/src/test/test-format-table.c index ff886a3d5ef..0f16ebffec8 100644 --- a/src/test/test-format-table.c +++ b/src/test/test-format-table.c @@ -617,7 +617,7 @@ TEST(signed_integers) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *a = NULL, *b = NULL; ASSERT_OK(table_to_json(t, &a)); - table_print_json(t, /* f= */ NULL, SD_JSON_FORMAT_NEWLINE); + table_print_json(t, /*f=*/ NULL, SD_JSON_FORMAT_NEWLINE); ASSERT_OK(sd_json_build(&b, SD_JSON_BUILD_ARRAY( @@ -679,7 +679,7 @@ TEST(unsigned_integers) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *a = NULL, *b = NULL; ASSERT_OK(table_to_json(t, &a)); - table_print_json(t, /* f= */ NULL, SD_JSON_FORMAT_NEWLINE); + table_print_json(t, /*f=*/ NULL, SD_JSON_FORMAT_NEWLINE); ASSERT_OK(sd_json_build(&b, SD_JSON_BUILD_ARRAY( diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c index 95eb1fa20bc..82e3ae60c7e 100644 --- a/src/test/test-glob-util.c +++ b/src/test/test-glob-util.c @@ -58,7 +58,7 @@ TEST(safe_glob) { ASSERT_NOT_NULL(mkdtemp(template)); fn = strjoina(template, "/*"); - ASSERT_ERROR(safe_glob(fn, /* flags= */ 0, &v), ENOENT); + ASSERT_ERROR(safe_glob(fn, /* flags = */ 0, &v), ENOENT); fn2 = strjoina(template, "/.*"); ASSERT_ERROR(safe_glob(fn2, GLOB_NOSORT|GLOB_BRACE, &v), ENOENT); @@ -66,7 +66,7 @@ TEST(safe_glob) { fname = strjoina(template, "/.foobar"); ASSERT_OK(touch(fname)); - ASSERT_ERROR(safe_glob(fn, /* flags= */ 0, &v), ENOENT); + ASSERT_ERROR(safe_glob(fn, /* flags = */ 0, &v), ENOENT); ASSERT_OK(safe_glob(fn2, GLOB_NOSORT|GLOB_BRACE, &v)); ASSERT_EQ(strv_length(v), 1u); diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c index 7f2aa73b14a..ce86dd0d2a3 100644 --- a/src/test/test-hexdecoct.c +++ b/src/test/test-hexdecoct.c @@ -94,7 +94,7 @@ static void test_unhexmem_one(const char *s, size_t l, int retval) { _cleanup_free_ void *mem = NULL; size_t len; - assert_se(unhexmem_full(s, l, /* secure= */ false, &mem, &len) == retval); + assert_se(unhexmem_full(s, l, /* secure = */ false, &mem, &len) == retval); if (retval == 0) { char *answer; @@ -460,7 +460,7 @@ static void test_unbase64mem_one(const char *input, const char *output, int ret) buffer = mfree(buffer); size = 0; - assert_se(unbase64mem_full(input, SIZE_MAX, /* secure= */ true, &buffer, &size) == ret); + assert_se(unbase64mem_full(input, SIZE_MAX, /* secure=*/ true, &buffer, &size) == ret); if (ret >= 0) { assert_se(size == strlen(output)); assert_se(memcmp(buffer, output, size) == 0); diff --git a/src/test/test-local-addresses.c b/src/test/test-local-addresses.c index 70a2a5bac90..52622a851ff 100644 --- a/src/test/test-local-addresses.c +++ b/src/test/test-local-addresses.c @@ -217,7 +217,7 @@ TEST(local_addresses_with_dummy) { reply = sd_netlink_message_unref(reply); /* Enable IPv6 for the case that it is disabled by default. */ - ASSERT_OK(sysctl_write_ip_property_boolean(AF_INET6, "test-local-addr", "disable_ipv6", false, /* shadow= */ NULL)); + ASSERT_OK(sysctl_write_ip_property_boolean(AF_INET6, "test-local-addr", "disable_ipv6", false, /* shadow = */ NULL)); /* Bring the interface up */ ASSERT_OK(sd_rtnl_message_new_link(rtnl, &message, RTM_SETLINK, ifindex)); diff --git a/src/test/test-log.c b/src/test/test-log.c index f77ed205a70..6ab44f73927 100644 --- a/src/test/test-log.c +++ b/src/test/test-log.c @@ -96,7 +96,7 @@ static void test_log_format_iovec_sentinel( va_start(ap, format); DISABLE_WARNING_FORMAT_NONLITERAL; - ASSERT_OK(log_format_iovec(iovec, iovec_len, &n, /* newline_separator= */ false, ENOANO, format, ap)); + ASSERT_OK(log_format_iovec(iovec, iovec_len, &n, /* newline_separator = */ false, ENOANO, format, ap)); REENABLE_WARNING; va_end(ap); @@ -114,7 +114,7 @@ static void test_log_format_iovec_sentinel( va_start(ap, format); DISABLE_WARNING_FORMAT_NONLITERAL; - ASSERT_OK(log_format_iovec(iovec, iovec_len, &n, /* newline_separator= */ true, ENOANO, format, ap)); + ASSERT_OK(log_format_iovec(iovec, iovec_len, &n, /* newline_separator = */ true, ENOANO, format, ap)); REENABLE_WARNING; va_end(ap); @@ -234,7 +234,7 @@ static void test_log_context(void) { _cleanup_(log_context_unrefp) LogContext *ctx = NULL; char **strv = STRV_MAKE("SIXTH=ijn", "SEVENTH=PRP"); - ASSERT_NOT_NULL(ctx = log_context_new_strv(strv, /* owned= */ false)); + ASSERT_NOT_NULL(ctx = log_context_new_strv(strv, /*owned=*/ false)); ASSERT_EQ(log_context_num_contexts(), 1U); ASSERT_EQ(log_context_num_fields(), 2U); diff --git a/src/test/test-mkdir.c b/src/test/test-mkdir.c index 0a9183de2f3..13dabe62759 100644 --- a/src/test/test-mkdir.c +++ b/src/test/test-mkdir.c @@ -82,7 +82,7 @@ TEST(mkdir_p_safe) { ASSERT_OK(mkdir_parents_safe(tmp, p, 0000, UID_INVALID, GID_INVALID, 0)); ASSERT_OK(r = safe_fork("(test-mkdir-no-cap)", FORK_DEATHSIG_SIGTERM | FORK_WAIT | FORK_LOG, NULL)); if (r == 0) { - (void) capability_bounding_set_drop(0, /* right_now= */ true); + (void) capability_bounding_set_drop(0, /* right_now = */ true); ASSERT_ERROR(mkdir_p_safe(tmp, p, 0000, UID_INVALID, GID_INVALID, 0), EACCES); _exit(EXIT_SUCCESS); } diff --git a/src/test/test-notify-recv.c b/src/test/test-notify-recv.c index 5be0b82bf8d..bca56df13b9 100644 --- a/src/test/test-notify-recv.c +++ b/src/test/test-notify-recv.c @@ -94,8 +94,8 @@ TEST(notify_socket_prepare) { ASSERT_OK(r = pidref_safe_fork("(test-notify-recv-child)", FORK_DEATHSIG_SIGTERM|FORK_LOG, &c.pidref)); if (r == 0) { - ASSERT_OK_ERRNO(setenv("NOTIFY_SOCKET", path, /* overwrite= */ true)); - ASSERT_OK_POSITIVE(sd_notify(/* unset_environment= */ false, "FIRST_MESSAGE=1")); + ASSERT_OK_ERRNO(setenv("NOTIFY_SOCKET", path, /* overwrite = */ true)); + ASSERT_OK_POSITIVE(sd_notify(/* unset_environment = */ false, "FIRST_MESSAGE=1")); _cleanup_close_ int fd1 = open("/tmp", O_RDONLY|O_CLOEXEC|O_DIRECTORY); ASSERT_OK_ERRNO(fd1); @@ -104,7 +104,7 @@ TEST(notify_socket_prepare) { ASSERT_OK_POSITIVE( sd_pid_notify_with_fds( - 0, /* unset_environment= */ false, + 0, /* unset_environment = */ false, "SECOND_MESSAGE=1\nADDITIONAL_DATA=hoge", (int[]) { fd1, fd2 }, 2)); _exit(EXIT_SUCCESS); } diff --git a/src/test/test-nss-hosts.c b/src/test/test-nss-hosts.c index 0307bcb45cc..1cc5e72007f 100644 --- a/src/test/test-nss-hosts.c +++ b/src/test/test-nss-hosts.c @@ -490,18 +490,18 @@ static int run(int argc, char **argv) { /* Testing with several syscalls filtered, and check if the nss modules gracefully handle failures in * masked syscalls. See issue #38582. */ - ASSERT_OK(r = safe_fork("(with-seccomp)", FORK_LOG | FORK_WAIT, /* ret_pid= */ NULL)); + ASSERT_OK(r = safe_fork("(with-seccomp)", FORK_LOG | FORK_WAIT, /* ret_pid = */ NULL)); if (r == 0) { _cleanup_hashmap_free_ Hashmap *filter = NULL; ASSERT_NOT_NULL(filter = hashmap_new(NULL)); FOREACH_STRING(s, "uname", "olduname", "oldolduname", "sigprocmask", "rt_sigprocmask", "osf_sigprocmask") - ASSERT_OK(seccomp_filter_set_add_by_name(filter, /* add= */ true, s)); - ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing= */ true)); + ASSERT_OK(seccomp_filter_set_add_by_name(filter, /* add = */ true, s)); + ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true)); /* To make assert_return() and friends not call abort(), even built as developer mode. */ - ASSERT_OK_ERRNO(setenv("SYSTEMD_ASSERT_RETURN_IS_CRITICAL", "0", /* overwrite= */ true)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_ASSERT_RETURN_IS_CRITICAL", "0", /* overwrite = */ true)); /* Let's also make nss modules output debugging logs. */ - ASSERT_OK_ERRNO(setenv("SYSTEMD_LOG_LEVEL", "debug", /* overwrite= */ true)); + ASSERT_OK_ERRNO(setenv("SYSTEMD_LOG_LEVEL", "debug", /* overwrite = */ true)); STRV_FOREACH(module, modules) ASSERT_OK(test_one_module(dir, *module, names, addresses, n_addresses)); diff --git a/src/test/test-osc-context.c b/src/test/test-osc-context.c index 9dadd425f29..030cb910848 100644 --- a/src/test/test-osc-context.c +++ b/src/test/test-osc-context.c @@ -10,79 +10,79 @@ TEST(osc) { log_info("boot"); ASSERT_OK(osc_context_open_boot(&seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(SD_ID128_ALLF, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("container"); sd_id128_t id; ASSERT_OK(osc_context_open_container("foobar", &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("vm"); ASSERT_OK(osc_context_open_vm("foobar", &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("chpriv → root"); ASSERT_OK(osc_context_open_chpriv("root", &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("chpriv → userxyz"); ASSERT_OK(osc_context_open_chpriv("userxyz", &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("chpriv → self"); _cleanup_free_ char *self = ASSERT_PTR(getusername_malloc()); ASSERT_OK(osc_context_open_chpriv(self, &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("session"); ASSERT_OK(osc_context_open_session("foobaruser", "session1", &seq, &id)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); log_info("service"); sd_id128_t invocation_id; ASSERT_OK(sd_id128_randomize(&invocation_id)); ASSERT_OK(osc_context_open_service("getty@tty1.service", invocation_id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); ASSERT_OK(osc_context_id_from_invocation_id(invocation_id, &id)); ASSERT_OK(osc_context_close(id, &seq)); - hexdump(/* f= */ NULL, seq, SIZE_MAX); + hexdump(/* f = */ NULL, seq, SIZE_MAX); seq = mfree(seq); } diff --git a/src/test/test-proc-cmdline.c b/src/test/test-proc-cmdline.c index 69ad4e212f2..68c4e77f75a 100644 --- a/src/test/test-proc-cmdline.c +++ b/src/test/test-proc-cmdline.c @@ -162,20 +162,20 @@ TEST(proc_cmdline_get_bool) { assert_se(putenv((char*) "SYSTEMD_PROC_CMDLINE=foo_bar bar-waldo=1 x_y-z=0 quux=miep\nda=yes\nthe=1") == 0); - assert_se(proc_cmdline_get_bool("", /* flags= */ 0, &value) == -EINVAL); - assert_se(proc_cmdline_get_bool("abc", /* flags= */ 0, &value) == 0 && value == false); + assert_se(proc_cmdline_get_bool("", /* flags = */ 0, &value) == -EINVAL); + assert_se(proc_cmdline_get_bool("abc", /* flags = */ 0, &value) == 0 && value == false); assert_se(proc_cmdline_get_bool("unspecified", PROC_CMDLINE_TRUE_WHEN_MISSING, &value) == 0 && value == true); - assert_se(proc_cmdline_get_bool("foo_bar", /* flags= */ 0, &value) > 0 && value == true); - assert_se(proc_cmdline_get_bool("foo-bar", /* flags= */ 0, &value) > 0 && value == true); - assert_se(proc_cmdline_get_bool("bar-waldo", /* flags= */ 0, &value) > 0 && value == true); - assert_se(proc_cmdline_get_bool("bar_waldo", /* flags= */ 0, &value) > 0 && value == true); - assert_se(proc_cmdline_get_bool("x_y-z", /* flags= */ 0, &value) > 0 && value == false); - assert_se(proc_cmdline_get_bool("x-y-z", /* flags= */ 0, &value) > 0 && value == false); - assert_se(proc_cmdline_get_bool("x-y_z", /* flags= */ 0, &value) > 0 && value == false); - assert_se(proc_cmdline_get_bool("x_y_z", /* flags= */ 0, &value) > 0 && value == false); - assert_se(proc_cmdline_get_bool("quux", /* flags= */ 0, &value) == -EINVAL && value == false); - assert_se(proc_cmdline_get_bool("da", /* flags= */ 0, &value) > 0 && value == true); - assert_se(proc_cmdline_get_bool("the", /* flags= */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("foo_bar", /* flags = */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("foo-bar", /* flags = */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("bar-waldo", /* flags = */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("bar_waldo", /* flags = */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("x_y-z", /* flags = */ 0, &value) > 0 && value == false); + assert_se(proc_cmdline_get_bool("x-y-z", /* flags = */ 0, &value) > 0 && value == false); + assert_se(proc_cmdline_get_bool("x-y_z", /* flags = */ 0, &value) > 0 && value == false); + assert_se(proc_cmdline_get_bool("x_y_z", /* flags = */ 0, &value) > 0 && value == false); + assert_se(proc_cmdline_get_bool("quux", /* flags = */ 0, &value) == -EINVAL && value == false); + assert_se(proc_cmdline_get_bool("da", /* flags = */ 0, &value) > 0 && value == true); + assert_se(proc_cmdline_get_bool("the", /* flags = */ 0, &value) > 0 && value == true); } TEST(proc_cmdline_get_key_many) { @@ -237,7 +237,7 @@ TEST(proc_cmdline_key_startswith) { \ /* This emulates pid_get_cmdline_strv(). */ \ assert_se(a = strv_parse_nulstr_full(s, ELEMENTSOF(s), \ - /* drop_trailing_nuls= */ true)); \ + /* drop_trailing_nuls = */ true)); \ assert_se(proc_cmdline_filter_pid1_args(a, &b) >= 0); \ assert_se(strv_equal(b, expected)); \ }) diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c index 81eed6d89d6..e81355abdd3 100644 --- a/src/test/test-seccomp.c +++ b/src/test/test-seccomp.c @@ -176,7 +176,7 @@ TEST(syscall_filter_set_find) { TEST(filter_sets) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); for (unsigned i = 0; i < _SYSCALL_FILTER_SET_MAX; i++) { @@ -293,7 +293,7 @@ TEST(restrict_namespace) { assert_se(namespace_flags_from_string(s, &ul) == 0 && ul == NAMESPACE_FLAGS_ALL); s = mfree(s); - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(restrict-namespace)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -350,7 +350,7 @@ TEST(protect_sysctl) { int r; /* in containers _sysctl() is likely missing anyway */ - CHECK_SECCOMP(/* skip_container= */ true); + CHECK_SECCOMP(/* skip_container = */ true); _cleanup_free_ char *seccomp = NULL; assert_se(get_proc_field("/proc/self/status", "Seccomp", &seccomp) == 0); @@ -386,7 +386,7 @@ TEST(protect_syslog) { int r; /* in containers syslog() is likely missing anyway */ - CHECK_SECCOMP(/* skip_container= */ true); + CHECK_SECCOMP(/* skip_container = */ true); ASSERT_OK(r = safe_fork("(protect-syslog)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -409,7 +409,7 @@ TEST(protect_syslog) { TEST(restrict_address_families) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(restrict-address-families)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -486,7 +486,7 @@ TEST(restrict_realtime) { int r; /* in containers RT privs are likely missing anyway */ - CHECK_SECCOMP(/* skip_container= */ true); + CHECK_SECCOMP(/* skip_container = */ true); ASSERT_OK(r = safe_fork("(restrict-realtime)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -529,7 +529,7 @@ TEST(restrict_realtime) { TEST(memory_deny_write_execute_mmap) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); #if HAVE_VALGRIND_VALGRIND_H if (RUNNING_ON_VALGRIND) { @@ -590,7 +590,7 @@ TEST(memory_deny_write_execute_shmat) { log_debug("arch %s: SCMP_SYS(shmdt) = %d", seccomp_arch_to_string(arch), SCMP_SYS(shmdt)); } - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); #if HAVE_VALGRIND_VALGRIND_H if (RUNNING_ON_VALGRIND) { @@ -646,7 +646,7 @@ TEST(memory_deny_write_execute_shmat) { TEST(restrict_archs) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(restrict-archs)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -673,7 +673,7 @@ TEST(restrict_archs) { TEST(load_syscall_filter_set_raw) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(load-filter)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -775,7 +775,7 @@ TEST(load_syscall_filter_set_raw) { TEST(native_syscalls_filtered) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(native-syscalls)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -823,7 +823,7 @@ TEST(lock_personality) { unsigned long current_opinionated; int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); assert_se(opinionated_personality(¤t_opinionated) >= 0); @@ -898,7 +898,7 @@ static int try_fchmodat2(int dirfd, const char *path, mode_t mode, int flags) { TEST(restrict_suid_sgid) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(suid-sgid)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { @@ -1122,7 +1122,7 @@ static void test_seccomp_suppress_sync_child(void) { TEST(seccomp_suppress_sync) { int r; - CHECK_SECCOMP(/* skip_container= */ false); + CHECK_SECCOMP(/* skip_container = */ false); ASSERT_OK(r = safe_fork("(suppress-sync)", FORK_LOG | FORK_WAIT, NULL)); if (r == 0) { diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index c56282781d2..f58be952ef3 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -13,7 +13,7 @@ #define TRIAL 100u static void set_timezone(const char *tz) { - ASSERT_OK(set_unset_env("TZ", tz, /* overwrite= */ true)); + ASSERT_OK(set_unset_env("TZ", tz, /* overwrite = */ true)); tzset(); log_info("TZ=%s, tzname[0]=%s, tzname[1]=%s", strna(getenv("TZ")), strempty(get_tzname(/* dst= */ false)), strempty(get_tzname(/* dst= */ true))); } @@ -431,7 +431,7 @@ static void test_format_timestamp_impl(usec_t x) { usec_t y_sec = y / USEC_PER_SEC; if (x_sec == y_sec && streq(xx, yy)) - return; /* Yay! */ + return; /* Yay!*/ /* When the timezone is built with rearguard being enabled (e.g. old Ubuntu and RHEL), the following * timezone may provide time shifted 1 hour from the original. See diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c index f45ae6b50a4..74346c4cd68 100644 --- a/src/test/test-uid-range.c +++ b/src/test/test-uid-range.c @@ -160,11 +160,11 @@ TEST(uid_range_coalesce) { _cleanup_(uid_range_freep) UIDRange *p = NULL; for (size_t i = 0; i < 10; i++) { - assert_se(uid_range_add_internal(&p, i * 10, 10, /* coalesce= */ false) >= 0); - assert_se(uid_range_add_internal(&p, i * 10 + 5, 10, /* coalesce= */ false) >= 0); + assert_se(uid_range_add_internal(&p, i * 10, 10, /* coalesce = */ false) >= 0); + assert_se(uid_range_add_internal(&p, i * 10 + 5, 10, /* coalesce = */ false) >= 0); } - assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce= */ true) >= 0); + assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce = */ true) >= 0); assert_se(p->n_entries == 1); assert_se(p->entries[0].start == 0); assert_se(p->entries[0].nr == 105); @@ -172,11 +172,11 @@ TEST(uid_range_coalesce) { p = uid_range_free(p); for (size_t i = 0; i < 10; i++) { - assert_se(uid_range_add_internal(&p, (10 - i) * 10, 10, /* coalesce= */ false) >= 0); - assert_se(uid_range_add_internal(&p, (10 - i) * 10 + 5, 10, /* coalesce= */ false) >= 0); + assert_se(uid_range_add_internal(&p, (10 - i) * 10, 10, /* coalesce = */ false) >= 0); + assert_se(uid_range_add_internal(&p, (10 - i) * 10 + 5, 10, /* coalesce = */ false) >= 0); } - assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce= */ true) >= 0); + assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce = */ true) >= 0); assert_se(p->n_entries == 1); assert_se(p->entries[0].start == 10); assert_se(p->entries[0].nr == 105); @@ -184,12 +184,12 @@ TEST(uid_range_coalesce) { p = uid_range_free(p); for (size_t i = 0; i < 10; i++) { - assert_se(uid_range_add_internal(&p, i * 10, 10, /* coalesce= */ false) >= 0); - assert_se(uid_range_add_internal(&p, i * 10 + 5, 10, /* coalesce= */ false) >= 0); - assert_se(uid_range_add_internal(&p, (10 - i) * 10, 10, /* coalesce= */ false) >= 0); - assert_se(uid_range_add_internal(&p, (10 - i) * 10 + 5, 10, /* coalesce= */ false) >= 0); + assert_se(uid_range_add_internal(&p, i * 10, 10, /* coalesce = */ false) >= 0); + assert_se(uid_range_add_internal(&p, i * 10 + 5, 10, /* coalesce = */ false) >= 0); + assert_se(uid_range_add_internal(&p, (10 - i) * 10, 10, /* coalesce = */ false) >= 0); + assert_se(uid_range_add_internal(&p, (10 - i) * 10 + 5, 10, /* coalesce = */ false) >= 0); } - assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce= */ true) >= 0); + assert_se(uid_range_add_internal(&p, 100, 1, /* coalesce = */ true) >= 0); assert_se(p->n_entries == 1); assert_se(p->entries[0].start == 0); assert_se(p->entries[0].nr == 115); diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 04730de1147..b2d6c0718cf 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -80,7 +80,7 @@ static int print_status_info(const StatusInfo *i) { SAVE_TIMEZONE; /* Set the new $TZ */ - if (setenv("TZ", isempty(i->timezone) ? "UTC" : i->timezone, /* overwrite= */ true) < 0) + if (setenv("TZ", isempty(i->timezone) ? "UTC" : i->timezone, /* overwrite = */ true) < 0) log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m"); else tzset(); diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index d1ef772b565..9016f6c4a6d 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -891,7 +891,7 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro } else timespec_store(&ts, (usec_t) utc); - /* refuse the request when the time is before systemd build date time */ + /* refuse the request when the time is before systemd build date time*/ if (ts.tv_sec < TIME_EPOCH) return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Requested to set the clock to time before build time, refusing."); diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index 79a9a629c14..dcd0e9131f7 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -1201,7 +1201,7 @@ int manager_setup_save_time_event(Manager *m) { m, SD_EVENT_PRIORITY_NORMAL, "save-time", - /* force_reset= */ false); + /* force_reset = */ false); if (r < 0) return log_error_errno(r, "Failed to reset event source for saving time: %m"); @@ -1217,7 +1217,7 @@ static int manager_save_time_and_rearm(Manager *m, usec_t t) { * clock, but otherwise uses the specified timestamp. Note that whenever we acquire an NTP sync the * specified timestamp value might be more accurate than the system clock, since the latter is * subject to slow adjustments. */ - r = touch_file(TIMESYNCD_CLOCK_FILE, /* parents= */ false, t, UID_INVALID, GID_INVALID, MODE_INVALID); + r = touch_file(TIMESYNCD_CLOCK_FILE, /* parents = */ false, t, UID_INVALID, GID_INVALID, MODE_INVALID); if (r < 0) log_debug_errno(r, "Failed to update "TIMESYNCD_CLOCK_FILE", ignoring: %m"); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index a458f3ad901..8def2a16de1 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -367,7 +367,7 @@ static int user_config_paths(char ***ret) { if (r < 0) return r; - r = strv_extend_strv_consume(&config_dirs, TAKE_PTR(data_dirs), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(&config_dirs, TAKE_PTR(data_dirs), /* filter_duplicates = */ true); if (r < 0) return r; @@ -1201,7 +1201,7 @@ static int fd_set_xattrs( "%s extended attribute '%s=%s' on %s", *name, *value, path); if (!arg_dry_run) { - r = xsetxattr(fd, /* path= */ NULL, AT_EMPTY_PATH, *name, *value); + r = xsetxattr(fd, /* path = */ NULL, AT_EMPTY_PATH, *name, *value); if (r < 0) return log_error_errno(r, "Failed to set extended attribute %s=%s on '%s': %m", *name, *value, path); @@ -1228,7 +1228,7 @@ static int path_set_xattrs( if (fd < 0) return fd; - return fd_set_xattrs(c, i, fd, path, /* st= */ NULL, creation); + return fd_set_xattrs(c, i, fd, path, /* st = */ NULL, creation); } static int parse_acls_from_arg(Item *item) { @@ -2132,7 +2132,7 @@ static int create_subvolume( return 0; } - fd = create_directory_or_subvolume(path, i->mode, /* subvol= */ true, i->allow_failure, &st, &creation); + fd = create_directory_or_subvolume(path, i->mode, /* subvol = */ true, i->allow_failure, &st, &creation); if (fd == -EEXIST) return 0; if (fd < 0) @@ -2420,7 +2420,7 @@ static int create_symlink(Context *c, Item *i) { assert(i); if (i->ignore_if_target_missing) { - r = chase(i->argument, arg_root, CHASE_SAFE|CHASE_PREFIX_ROOT|CHASE_NOFOLLOW, /* ret_path= */ NULL, /* ret_fd= */ NULL); + r = chase(i->argument, arg_root, CHASE_SAFE|CHASE_PREFIX_ROOT|CHASE_NOFOLLOW, /* ret_path = */ NULL, /* ret_fd = */ NULL); if (r == -ENOENT) { /* Silently skip over lines where the source file is missing. */ log_info("Symlink source path '%s/%s' does not exist, skipping line.", @@ -3958,7 +3958,7 @@ static int parse_line( _cleanup_free_ void *data = NULL; size_t data_size = 0; - r = unbase64mem_full(item_binary_argument(&i), item_binary_argument_size(&i), /* secure= */ false, + r = unbase64mem_full(item_binary_argument(&i), item_binary_argument_size(&i), /* secure = */ false, &data, &data_size); if (r < 0) return log_syntax(NULL, LOG_ERR, fname, line, r, "Failed to base64 decode specified argument '%s': %m", i.argument); diff --git a/src/tpm2-setup/tpm2-setup.c b/src/tpm2-setup/tpm2-setup.c index c73dd377ed8..d33a41b8938 100644 --- a/src/tpm2-setup/tpm2-setup.c +++ b/src/tpm2-setup/tpm2-setup.c @@ -98,7 +98,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_TPM2_DEVICE: if (streq(optarg, "list")) - return tpm2_list_devices(/* legend= */ true, /* quiet= */ false); + return tpm2_list_devices(/* legend = */ true, /* quiet = */ false); if (free_and_strdup(&arg_tpm2_device, streq(optarg, "auto") ? NULL : optarg) < 0) return log_oom(); diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 4a2b47ca19e..3aefc898eea 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -687,7 +687,7 @@ static int ask_on_consoles(char *argv[]) { * * Note that when any agent exits STOPPING=1 would also be sent, but that's utterly what we want, * i.e. the password is answered on one console and other agents get killed below. */ - (void) sd_notify(/* unset_environment= */ false, "NOTIFYACCESS=all"); + (void) sd_notify(/* unset_environment = */ false, "NOTIFYACCESS=all"); /* Start an agent on each console. */ STRV_FOREACH(tty, consoles) { diff --git a/src/udev/fuzz-udev-rules.c b/src/udev/fuzz-udev-rules.c index e91954311da..34567471e87 100644 --- a/src/udev/fuzz-udev-rules.c +++ b/src/udev/fuzz-udev-rules.c @@ -29,9 +29,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { assert_se(rules = udev_rules_new(RESOLVE_NAME_EARLY)); _cleanup_(conf_file_freep) ConfFile *c = NULL; - ASSERT_OK(conf_file_new(filename, /* root= */ NULL, CHASE_MUST_BE_REGULAR, &c)); + ASSERT_OK(conf_file_new(filename, /* root = */ NULL, CHASE_MUST_BE_REGULAR, &c)); - r = udev_rules_parse_file(rules, c, /* extra_checks= */ false, /* ret= */ NULL); + r = udev_rules_parse_file(rules, c, /* extra_checks = */ false, /* ret = */ NULL); log_info_errno(r, "Parsing %s: %m", filename); assert_se(r >= 0 || /* OK */ r == -ENOBUFS); /* line length exceeded */ diff --git a/src/udev/iocost/iocost.c b/src/udev/iocost/iocost.c index a1c9e0c9ede..8e2fabbe2c8 100644 --- a/src/udev/iocost/iocost.c +++ b/src/udev/iocost/iocost.c @@ -222,13 +222,13 @@ static int apply_solution_for_path(const char *path, const char *name) { "\tio.cost.model: %s\n", path, name, qos, model); - r = cg_set_attribute(/* path= */ NULL, "io.cost.qos", qos); + r = cg_set_attribute(/* path = */ NULL, "io.cost.qos", qos); if (r < 0) { log_device_full_errno(device, r == -ENOENT ? LOG_DEBUG : LOG_ERR, r, "Failed to set io.cost.qos: %m"); return r == -ENOENT ? 0 : r; } - r = cg_set_attribute(/* path= */ NULL, "io.cost.model", model); + r = cg_set_attribute(/* path = */ NULL, "io.cost.model", model); if (r < 0) { log_device_full_errno(device, r == -ENOENT ? LOG_DEBUG : LOG_ERR, r, "Failed to set io.cost.model: %m"); return r == -ENOENT ? 0 : r; diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 35dfa0d95a1..70971ca2f56 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -284,7 +284,7 @@ int link_load_one(LinkConfigContext *ctx, const char *filename) { STRV_MAKE_CONST(filename), NETWORK_DIRS, dropin_dirname, - /* root= */ NULL, + /* root = */ NULL, "Match\0" "Link\0" "SR-IOV\0" @@ -358,7 +358,7 @@ bool link_config_should_reload(LinkConfigContext *ctx) { assert(ctx); - r = config_get_stats_by_path(".link", NULL, 0, NETWORK_DIRS, /* check_dropins= */ true, &stats_by_path); + r = config_get_stats_by_path(".link", NULL, 0, NETWORK_DIRS, /* check_dropins = */ true, &stats_by_path); if (r < 0) { log_warning_errno(r, "Failed to get stats of .link files, ignoring: %m"); return true; @@ -456,10 +456,10 @@ int link_get_config(LinkConfigContext *ctx, Link *link) { link->iftype, link->kind, link->ifname, - /* alternative_names= */ NULL, - /* wlan_iftype= */ 0, - /* ssid= */ NULL, - /* bssid= */ NULL); + /* alternative_names = */ NULL, + /* wlan_iftype = */ 0, + /* ssid = */ NULL, + /* bssid = */ NULL); if (r < 0) return r; if (r == 0) @@ -720,7 +720,7 @@ static bool enable_name_policy(void) { if (cached >= 0) return cached; - r = proc_cmdline_get_bool("net.ifnames", /* flags= */ 0, &b); + r = proc_cmdline_get_bool("net.ifnames", /* flags = */ 0, &b); if (r < 0) log_warning_errno(r, "Failed to parse net.ifnames= kernel command line option, ignoring: %m"); if (r <= 0) diff --git a/src/udev/test-udev-rule-runner.c b/src/udev/test-udev-rule-runner.c index 7a516096906..cc870dcdb76 100644 --- a/src/udev/test-udev-rule-runner.c +++ b/src/udev/test-udev-rule-runner.c @@ -134,7 +134,7 @@ static int run(int argc, char *argv[]) { usleep_safe(us); } - assert_se(udev_rules_load(&rules, RESOLVE_NAME_EARLY, /* extra= */ NULL) == 0); + assert_se(udev_rules_load(&rules, RESOLVE_NAME_EARLY, /* extra = */ NULL) == 0); const char *syspath = strjoina("/sys", devpath); r = device_new_from_synthetic_event(&dev, syspath, action); diff --git a/src/udev/test-udev-rules.c b/src/udev/test-udev-rules.c index 45926decc93..031937347af 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", /* expected_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", /* 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); + 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\"\"", "", /* expected_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", /* expected_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\"\\\"\"", "\"", /* expected_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, /* expected_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, /* expected_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\"\\\\\"", "\\", /* expected_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, /* expected_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\"\\\\\\\"\"", "\\\"", /* expected_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\"\\\\\\\\\"", "\\\\", /* expected_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", /* expected_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", /* expected_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, /* expected_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, /* expected_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", - /* expected_case_insensitive= */ false, 0); + /* expected_case_insensitive = */ false, 0); /* input: i"ABCD1234" */ - test_udev_rule_parse_value_one("i\"ABCD1234\"", "ABCD1234", /* expected_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", /* expected_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", /* expected_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", /* expected_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, /* expected_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, /* expected_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, /* expected_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, /* expected_case_insensitive= */ false, -EINVAL); + test_udev_rule_parse_value_one("a\"\"", NULL, /* expected_case_insensitive = */ false, -EINVAL); } DEFINE_TEST_MAIN(LOG_DEBUG); diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c index 20ca5066872..4fe37971eea 100644 --- a/src/udev/udev-builtin-kmod.c +++ b/src/udev/udev-builtin-kmod.c @@ -32,7 +32,7 @@ static int builtin_kmod(UdevEvent *event, int argc, char *argv[]) { char **modules = strv_skip(argv, 2); if (modules) STRV_FOREACH(module, modules) - (void) module_load_and_warn(ctx, *module, /* verbose= */ false); + (void) module_load_and_warn(ctx, *module, /* verbose = */ false); else { const char *modalias; @@ -40,7 +40,7 @@ static int builtin_kmod(UdevEvent *event, int argc, char *argv[]) { if (r < 0) return log_device_warning_errno(dev, r, "Failed to read property \"MODALIAS\": %m"); - (void) module_load_and_warn(ctx, modalias, /* verbose= */ false); + (void) module_load_and_warn(ctx, modalias, /* verbose = */ false); } return 0; diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index a41ecb1d43c..974955b2ec2 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -107,7 +107,7 @@ static int get_first_syspath_component(sd_device *dev, const char *prefix, char if (!p) return -EINVAL; - r = path_find_first_component(&p, /* accept_dot_dot= */ false, &q); + r = path_find_first_component(&p, /* accept_dot_dot = */ false, &q); if (r < 0) return r; @@ -692,7 +692,7 @@ static int names_vio(UdevEvent *event, const char *prefix) { /* get ibmveth/ibmvnic slot-based names. */ /* check if our direct parent is a VIO device with no other bus in-between */ - if (get_matching_parent(dev, STRV_MAKE("vio"), /* skip_virtio= */ false, NULL) < 0) + if (get_matching_parent(dev, STRV_MAKE("vio"), /* skip_virtio = */ false, NULL) < 0) return 0; log_device_debug(dev, "Parent device is in the vio subsystem."); @@ -739,7 +739,7 @@ static int names_platform(UdevEvent *event, const char *prefix) { /* get ACPI path names for ARM64 platform devices */ /* check if our direct parent is a platform device with no other bus in-between */ - if (get_matching_parent(dev, STRV_MAKE("platform"), /* skip_virtio= */ false, NULL) < 0) + if (get_matching_parent(dev, STRV_MAKE("platform"), /* skip_virtio = */ false, NULL) < 0) return 0; log_device_debug(dev, "Parent device is in the platform subsystem."); @@ -934,7 +934,7 @@ static int names_pci(UdevEvent *event, const char *prefix) { assert(prefix); /* check if our direct parent is a PCI device with no other bus in-between */ - if (get_matching_parent(dev, STRV_MAKE("pci"), /* skip_virtio= */ true, &parent) < 0) + if (get_matching_parent(dev, STRV_MAKE("pci"), /* skip_virtio = */ true, &parent) < 0) return 0; /* If this is an SR-IOV virtual device, get base name using physical device and add virtfn suffix. */ @@ -1103,7 +1103,7 @@ static int names_ccw(UdevEvent *event, const char *prefix) { /* get path names for Linux on System z network devices */ - if (get_matching_parent(dev, STRV_MAKE("ccwgroup", "ccw"), /* skip_virtio= */ true, &cdev) < 0) + if (get_matching_parent(dev, STRV_MAKE("ccwgroup", "ccw"), /* skip_virtio = */ true, &cdev) < 0) return 0; log_device_debug(dev, "Device is CCW."); @@ -1271,7 +1271,7 @@ static int names_xen(UdevEvent *event, const char *prefix) { return 0; /* check if our direct parent is a Xen VIF device with no other bus in-between */ - if (get_matching_parent(dev, STRV_MAKE("xen"), /* skip_virtio= */ false, NULL) < 0) + if (get_matching_parent(dev, STRV_MAKE("xen"), /* skip_virtio = */ false, NULL) < 0) return 0; /* Use the vif-n name to extract "n" */ diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c index fcbf2674652..e73ec7c03d6 100644 --- a/src/udev/udev-builtin-uaccess.c +++ b/src/udev/udev-builtin-uaccess.c @@ -39,7 +39,7 @@ static int builtin_uaccess(UdevEvent *event, int argc, char *argv[]) { return log_device_error_errno(dev, r, "Failed to get seat: %m"); uid_t uid; - r = sd_seat_get_active(seat, /* ret_session= */ NULL, &uid); + r = sd_seat_get_active(seat, /* ret_session = */ NULL, &uid); if (r < 0) { if (IN_SET(r, -ENXIO, -ENODATA)) /* No active session on this seat */ @@ -60,7 +60,7 @@ static int builtin_uaccess(UdevEvent *event, int argc, char *argv[]) { reset: /* Better be safe than sorry and reset ACL */ - k = devnode_acl(fd, /* uid= */ 0); + k = devnode_acl(fd, /* uid = */ 0); if (k < 0) RET_GATHER(r, log_device_full_errno(dev, k == -ENOENT ? LOG_DEBUG : LOG_ERR, k, "Failed to flush ACLs: %m")); diff --git a/src/udev/udev-dump.c b/src/udev/udev-dump.c index e8d23377ff6..d5e420d120b 100644 --- a/src/udev/udev-dump.c +++ b/src/udev/udev-dump.c @@ -293,7 +293,7 @@ static int dump_event_json(UdevEvent *event, sd_json_format_flags_t flags, FILE if (r < 0) return r; - return sd_json_variant_dump(v, flags, f, /* prefix= */ NULL); + return sd_json_variant_dump(v, flags, f, /* prefix = */ NULL); } int dump_event(UdevEvent *event, sd_json_format_flags_t flags, FILE *f) { diff --git a/src/udev/udev-error.c b/src/udev/udev-error.c index 9f06ed4a1ce..c61df6fbaac 100644 --- a/src/udev/udev-error.c +++ b/src/udev/udev-error.c @@ -63,9 +63,9 @@ int device_broadcast_on_error(sd_device *dev, sd_device_monitor *monitor) { /* delete state from disk */ (void) device_delete_db(dev); - (void) device_tag_index(dev, /* device_old= */ NULL, /* add= */ false); + (void) device_tag_index(dev, /* device_old = */ NULL, /* add = */ false); - r = device_monitor_send(monitor, /* destination= */ NULL, dev); + r = device_monitor_send(monitor, /* destination = */ NULL, dev); if (r < 0) { uint64_t seqnum = 0; diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index ad7b9fc7761..2cc6c04a2c5 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -96,7 +96,7 @@ static int device_rename(sd_device *device, const char *name) { /* At the time this is called, the renamed device may not exist yet. Hence, we cannot validate * the new syspath. */ - r = device_set_syspath(device, new_syspath, /* verify= */ false); + r = device_set_syspath(device, new_syspath, /* verify = */ false); if (r < 0) return r; @@ -219,7 +219,7 @@ static int rename_netif(UdevEvent *event) { (void) device_update_db(event->dev_db_clone); /* Restore 'dev' */ - (void) device_set_syspath(dev, old_syspath, /* verify= */ false); + (void) device_set_syspath(dev, old_syspath, /* verify = */ false); if (sd_device_get_property_value(dev, "INTERFACE_OLD", &s) >= 0) { (void) device_add_property_internal(dev, "INTERFACE", s); (void) device_add_property_internal(dev, "INTERFACE_OLD", NULL); diff --git a/src/udev/udev-manager-ctrl.c b/src/udev/udev-manager-ctrl.c index c395993a243..d9cc44bc5ca 100644 --- a/src/udev/udev-manager-ctrl.c +++ b/src/udev/udev-manager-ctrl.c @@ -38,7 +38,7 @@ static int on_ctrl_msg(UdevCtrl *uctrl, UdevCtrlMessageType type, const UdevCtrl break; case UDEV_CTRL_RELOAD: log_debug("Received udev control message (RELOAD)"); - manager_reload(manager, /* force= */ true); + manager_reload(manager, /* force = */ true); break; case UDEV_CTRL_SET_ENV: if (!udev_property_assignment_is_valid(value->buf)) { diff --git a/src/udev/udev-manager.c b/src/udev/udev-manager.c index 8505bcdf266..0dac43a3fba 100644 --- a/src/udev/udev-manager.c +++ b/src/udev/udev-manager.c @@ -284,7 +284,7 @@ int manager_reset_kill_workers_timer(Manager *manager) { manager, EVENT_PRIORITY_WORKER_TIMER, "kill-workers-event", - /* force_reset= */ false); + /* force_reset = */ false); if (r < 0) return log_warning_errno(r, "Failed to enable timer event source for cleaning up workers: %m"); } @@ -369,7 +369,7 @@ void manager_reload(Manager *manager, bool force) { udev_builtin_reload(flags); if (FLAGS_SET(flags, UDEV_RELOAD_RULES)) { - r = udev_rules_load(&rules, manager->config.resolve_name_timing, /* extra= */ NULL); + r = udev_rules_load(&rules, manager->config.resolve_name_timing, /* extra = */ NULL); if (r < 0) log_warning_errno(r, "Failed to read udev rules, using the previously loaded rules, ignoring: %m"); else @@ -514,7 +514,7 @@ static void worker_attach_event(Worker *worker, Event *event) { worker, EVENT_PRIORITY_WORKER_TIMER, "worker-timeout-warn", - /* force_reset= */ true); + /* force_reset = */ true); (void) event_reset_time_relative( manager->event, @@ -526,7 +526,7 @@ static void worker_attach_event(Worker *worker, Event *event) { worker, EVENT_PRIORITY_WORKER_TIMER, "worker-timeout-kill", - /* force_reset= */ true); + /* force_reset = */ true); } static Event* worker_detach_event(Worker *worker) { @@ -580,7 +580,7 @@ static int worker_spawn(Manager *manager, Event *event) { .manager_pid = manager_pid, }; - if (setenv("NOTIFY_SOCKET", manager->worker_notify_socket_path, /* overwrite= */ true) < 0) { + if (setenv("NOTIFY_SOCKET", manager->worker_notify_socket_path, /* overwrite = */ true) < 0) { log_error_errno(errno, "Failed to set $NOTIFY_SOCKET: %m"); _exit(EXIT_FAILURE); } @@ -726,7 +726,7 @@ static int event_queue_start(Manager *manager) { if (r < 0) log_warning_errno(r, "Failed to disable event source for cleaning up idle workers, ignoring: %m"); - manager_reload(manager, /* force= */ false); + manager_reload(manager, /* force = */ false); /* manager_reload() may kill idle workers, hence we may not be possible to start processing an event. * Let's check that and return earlier if we cannot. */ @@ -789,10 +789,10 @@ static int manager_requeue_locked_events(Manager *manager) { event->requeue_next_usec, USEC_PER_SEC, on_requeue_locked_events, - /* userdata= */ NULL, + /* userdata = */ NULL, EVENT_PRIORITY_REQUEUE_EVENT, "requeue-locked-events", - /* force_reset= */ true); + /* force_reset = */ true); assert_se(prioq_pop(manager->locked_events_by_time) == event); event_unset_whole_disk(event); @@ -1026,7 +1026,7 @@ static int manager_deserialize_events(Manager *manager, int *fd) { if (manager->events) return log_warning_errno(SYNTHETIC_ERRNO(EALREADY), "Received multiple event storage socket (%i).", *fd); - r = sd_is_socket(*fd, AF_NETLINK, SOCK_RAW, /* listening= */ -1); + r = sd_is_socket(*fd, AF_NETLINK, SOCK_RAW, /* listening = */ -1); if (r < 0) return log_warning_errno(r, "Failed to verify type of event storage socket (%i): %m", *fd); if (r == 0) @@ -1101,7 +1101,7 @@ static int manager_init_device_monitor(Manager *manager, int fd) { if (manager->monitor) return log_warning_errno(SYNTHETIC_ERRNO(EALREADY), "Received multiple netlink socket (%i), ignoring.", fd); - r = sd_is_socket(fd, AF_NETLINK, SOCK_RAW, /* listening= */ -1); + r = sd_is_socket(fd, AF_NETLINK, SOCK_RAW, /* listening = */ -1); if (r < 0) return log_warning_errno(r, "Failed to verify socket type of %i, ignoring: %m", fd); if (r == 0) @@ -1251,7 +1251,7 @@ static int on_sigterm(sd_event_source *s, const struct signalfd_siginfo *si, voi static int on_sighup(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { Manager *manager = ASSERT_PTR(userdata); - manager_reload(manager, /* force= */ true); + manager_reload(manager, /* force = */ true); return 1; } @@ -1321,7 +1321,7 @@ static int on_post(sd_event_source *s, void *userdata) { if (manager->cgroup && set_isempty(manager->synthesize_change_child_event_sources)) /* cleanup possible left-over processes in our cgroup */ - (void) cg_kill(manager->cgroup, SIGKILL, CGROUP_IGNORE_SELF, /* killed_pids= */ NULL, /* log_kill= */ NULL, /* userdata= */ NULL); + (void) cg_kill(manager->cgroup, SIGKILL, CGROUP_IGNORE_SELF, /* killed_pids=*/ NULL, /* log_kill= */ NULL, /* userdata= */ NULL); return 0; } @@ -1382,7 +1382,7 @@ static int manager_setup_event(Manager *manager) { if (r < 0) return log_error_errno(r, "Failed to create SIGHUP event source: %m"); - r = sd_event_add_post(e, /* ret= */ NULL, on_post, manager); + r = sd_event_add_post(e, /* ret = */ NULL, on_post, manager); if (r < 0) return log_error_errno(r, "Failed to create post event source: %m"); @@ -1413,7 +1413,7 @@ static int manager_listen_fds(Manager *manager, int *ret_varlink_fd) { assert(manager); assert(ret_varlink_fd); - int n = sd_listen_fds_with_names(/* unset_environment= */ true, &names); + int n = sd_listen_fds_with_names(/* unset_environment = */ true, &names); if (n < 0) return log_error_errno(n, "Failed to listen on fds: %m"); @@ -1492,7 +1492,7 @@ int manager_main(Manager *manager) { udev_builtin_init(); - r = udev_rules_load(&manager->rules, manager->config.resolve_name_timing, /* extra= */ NULL); + r = udev_rules_load(&manager->rules, manager->config.resolve_name_timing, /* extra = */ NULL); if (r < 0) return log_error_errno(r, "Failed to read udev rules: %m"); diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index d30ffd9a56e..5abaf1eff39 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -545,7 +545,7 @@ static int link_update(sd_device *dev, const char *slink, bool add) { /* This device has the equal or a higher priority than the current. Let's create the devlink to our * device node. */ - return node_create_symlink(dev, /* devnode= */ NULL, slink); + return node_create_symlink(dev, /* devnode = */ NULL, slink); } static int device_get_devpath_by_devnum(sd_device *dev, char **ret) { @@ -583,7 +583,7 @@ int udev_node_update(sd_device *dev, sd_device *dev_old) { "Removing/updating old device symlink '%s', which is no longer belonging to this device.", devlink); - r = link_update(dev, devlink, /* add= */ false); + r = link_update(dev, devlink, /* add = */ false); if (r < 0) log_device_warning_errno(dev, r, "Failed to remove/update device symlink '%s', ignoring: %m", @@ -592,7 +592,7 @@ int udev_node_update(sd_device *dev, sd_device *dev_old) { /* create/update symlinks, add symlinks to name index */ FOREACH_DEVICE_DEVLINK(dev, devlink) { - r = link_update(dev, devlink, /* add= */ true); + r = link_update(dev, devlink, /* add = */ true); if (r < 0) log_device_warning_errno(dev, r, "Failed to create/update device symlink '%s', ignoring: %m", @@ -604,7 +604,7 @@ int udev_node_update(sd_device *dev, sd_device *dev_old) { return log_device_debug_errno(dev, r, "Failed to get device path: %m"); /* always add /dev/{block,char}/$major:$minor */ - r = node_create_symlink(dev, /* devnode= */ NULL, filename); + r = node_create_symlink(dev, /* devnode = */ NULL, filename); if (r < 0) return log_device_warning_errno(dev, r, "Failed to create device symlink '%s': %m", filename); @@ -619,7 +619,7 @@ int udev_node_remove(sd_device *dev) { /* remove/update symlinks, remove symlinks from name index */ FOREACH_DEVICE_DEVLINK(dev, devlink) { - r = link_update(dev, devlink, /* add= */ false); + r = link_update(dev, devlink, /* add = */ false); if (r < 0) log_device_warning_errno(dev, r, "Failed to remove/update device symlink '%s', ignoring: %m", diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 6213a7e58f7..aea7ac6e20d 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -769,7 +769,7 @@ static int parse_token( return log_line_invalid_attr(rule_line, key); if (!is_match) { check_value_format_and_warn(rule_line, key, value, false); - r = rule_line_add_token(rule_line, TK_A_DEVLINK, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_DEVLINK, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_DEVLINK, op, value, NULL, is_case_insensitive, token_str); } else if (streq(key, "NAME")) { @@ -791,7 +791,7 @@ static int parse_token( "Ignoring NAME=\"\", as udev will not delete any network interfaces."); check_value_format_and_warn(rule_line, key, value, false); - r = rule_line_add_token(rule_line, TK_A_NAME, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_NAME, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_NAME, op, value, NULL, is_case_insensitive, token_str); } else if (streq(key, "ENV")) { @@ -811,7 +811,7 @@ static int parse_token( check_value_format_and_warn(rule_line, key, value, false); - r = rule_line_add_token(rule_line, TK_A_ENV, op, value, attr, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_ENV, op, value, attr, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_ENV, op, value, attr, is_case_insensitive, token_str); } else if (streq(key, "CONST")) { @@ -831,7 +831,7 @@ static int parse_token( if (!is_match) { check_value_format_and_warn(rule_line, key, value, true); - r = rule_line_add_token(rule_line, TK_A_TAG, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_TAG, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_TAG, op, value, NULL, is_case_insensitive, token_str); } else if (streq(key, "SUBSYSTEM")) { @@ -864,7 +864,7 @@ static int parse_token( if (!is_match) { check_value_format_and_warn(rule_line, key, value, false); - r = rule_line_add_token(rule_line, TK_A_ATTR, op, value, attr, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_ATTR, op, value, attr, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_ATTR, op, value, attr, is_case_insensitive, token_str); } else if (streq(key, "SYSCTL")) { @@ -880,7 +880,7 @@ static int parse_token( if (!is_match) { check_value_format_and_warn(rule_line, key, value, false); - r = rule_line_add_token(rule_line, TK_A_SYSCTL, op, value, attr, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_SYSCTL, op, value, attr, /* is_case_insensitive = */ false, token_str); } else r = rule_line_add_token(rule_line, TK_M_SYSCTL, op, value, attr, is_case_insensitive, token_str); } else if (streq(key, "KERNELS")) { @@ -950,7 +950,7 @@ static int parse_token( if (is_case_insensitive) return log_line_invalid_prefix(rule_line, key); - r = rule_line_add_token(rule_line, TK_M_PROGRAM, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_PROGRAM, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else if (streq(key, "IMPORT")) { if (isempty(attr)) return log_line_invalid_attr(rule_line, key); @@ -963,16 +963,16 @@ static int parse_token( return log_line_invalid_prefix(rule_line, key); if (streq(attr, "file")) - r = rule_line_add_token(rule_line, TK_M_IMPORT_FILE, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_FILE, op, value, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(attr, "program")) { UdevBuiltinCommand cmd; cmd = udev_builtin_lookup(value); if (cmd >= 0) { log_line_debug(rule_line, "Found builtin command '%s' for %s, replacing attribute.", value, key); - r = rule_line_add_token(rule_line, TK_M_IMPORT_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive = */ false, token_str); } else - r = rule_line_add_token(rule_line, TK_M_IMPORT_PROGRAM, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_PROGRAM, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else if (streq(attr, "builtin")) { UdevBuiltinCommand cmd; @@ -980,13 +980,13 @@ static int parse_token( if (cmd < 0) return log_line_error_errno(rule_line, SYNTHETIC_ERRNO(EINVAL), "Unknown builtin command: %s", value); - r = rule_line_add_token(rule_line, TK_M_IMPORT_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive = */ false, token_str); } else if (streq(attr, "db")) - r = rule_line_add_token(rule_line, TK_M_IMPORT_DB, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_DB, op, value, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(attr, "cmdline")) - r = rule_line_add_token(rule_line, TK_M_IMPORT_CMDLINE, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_CMDLINE, op, value, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(attr, "parent")) - r = rule_line_add_token(rule_line, TK_M_IMPORT_PARENT, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_M_IMPORT_PARENT, op, value, NULL, /* is_case_insensitive = */ false, token_str); else return log_line_invalid_attr(rule_line, key); } else if (streq(key, "RESULT")) { @@ -1007,28 +1007,28 @@ static int parse_token( op = OP_ASSIGN; if (streq(value, "dump")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_DUMP, op, NULL, UINT_TO_PTR(SD_JSON_FORMAT_OFF), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_DUMP, op, NULL, UINT_TO_PTR(SD_JSON_FORMAT_OFF), /* is_case_insensitive = */ false, token_str); else if (streq(value, "dump-json")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_DUMP, op, NULL, UINT_TO_PTR(SD_JSON_FORMAT_NEWLINE), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_DUMP, op, NULL, UINT_TO_PTR(SD_JSON_FORMAT_NEWLINE), /* is_case_insensitive = */ false, token_str); else if (streq(value, "string_escape=none")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_STRING_ESCAPE_NONE, op, NULL, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_STRING_ESCAPE_NONE, op, NULL, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(value, "string_escape=replace")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_STRING_ESCAPE_REPLACE, op, NULL, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_STRING_ESCAPE_REPLACE, op, NULL, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(value, "db_persist")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_DB_PERSIST, op, NULL, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_DB_PERSIST, op, NULL, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(value, "watch")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_INOTIFY_WATCH, op, NULL, INT_TO_PTR(1), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_INOTIFY_WATCH, op, NULL, INT_TO_PTR(1), /* is_case_insensitive = */ false, token_str); else if (streq(value, "nowatch")) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_INOTIFY_WATCH, op, NULL, INT_TO_PTR(0), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_INOTIFY_WATCH, op, NULL, INT_TO_PTR(0), /* is_case_insensitive = */ false, token_str); else if ((tmp = startswith(value, "static_node="))) - r = rule_line_add_token(rule_line, TK_A_OPTIONS_STATIC_NODE, op, tmp, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_STATIC_NODE, op, tmp, NULL, /* is_case_insensitive = */ false, token_str); else if ((tmp = startswith(value, "link_priority="))) { int prio; r = safe_atoi(tmp, &prio); if (r < 0) return log_line_error_errno(rule_line, r, "Failed to parse link priority '%s': %m", tmp); - r = rule_line_add_token(rule_line, TK_A_OPTIONS_DEVLINK_PRIORITY, op, NULL, INT_TO_PTR(prio), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_DEVLINK_PRIORITY, op, NULL, INT_TO_PTR(prio), /* is_case_insensitive = */ false, token_str); } else if ((tmp = startswith(value, "log_level="))) { int level; @@ -1039,7 +1039,7 @@ static int parse_token( if (level < 0) return log_line_error_errno(rule_line, level, "Failed to parse log level '%s': %m", tmp); } - r = rule_line_add_token(rule_line, TK_A_OPTIONS_LOG_LEVEL, op, NULL, INT_TO_PTR(level), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OPTIONS_LOG_LEVEL, op, NULL, INT_TO_PTR(level), /* is_case_insensitive = */ false, token_str); } else { log_line_warning(rule_line, "Invalid value for OPTIONS key, ignoring: '%s'", value); return 0; @@ -1064,10 +1064,10 @@ static int parse_token( return r; assert(uid_is_valid(uid)); - r = rule_line_add_token(rule_line, TK_A_OWNER_ID, op, NULL, UID_TO_PTR(uid), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OWNER_ID, op, NULL, UID_TO_PTR(uid), /* is_case_insensitive = */ false, token_str); } else if (resolve_name_timing != RESOLVE_NAME_NEVER) { check_value_format_and_warn(rule_line, key, value, true); - r = rule_line_add_token(rule_line, TK_A_OWNER, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_OWNER, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else { log_line_debug(rule_line, "User name resolution is disabled, ignoring %s=\"%s\".", key, value); return 0; @@ -1092,10 +1092,10 @@ static int parse_token( return r; assert(gid_is_valid(gid)); - r = rule_line_add_token(rule_line, TK_A_GROUP_ID, op, NULL, GID_TO_PTR(gid), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_GROUP_ID, op, NULL, GID_TO_PTR(gid), /* is_case_insensitive = */ false, token_str); } else if (resolve_name_timing != RESOLVE_NAME_NEVER) { check_value_format_and_warn(rule_line, key, value, true); - r = rule_line_add_token(rule_line, TK_A_GROUP, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_GROUP, op, value, NULL, /* is_case_insensitive = */ false, token_str); } else { log_line_debug(rule_line, "Resolving group name is disabled, ignoring GROUP=\"%s\".", value); return 0; @@ -1113,10 +1113,10 @@ static int parse_token( } if (parse_mode(value, &mode) >= 0) - r = rule_line_add_token(rule_line, TK_A_MODE_ID, op, NULL, MODE_TO_PTR(mode), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_MODE_ID, op, NULL, MODE_TO_PTR(mode), /* is_case_insensitive = */ false, token_str); else { check_value_format_and_warn(rule_line, key, value, true); - r = rule_line_add_token(rule_line, TK_A_MODE, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_MODE, op, value, NULL, /* is_case_insensitive = */ false, token_str); } } else if (streq(key, "SECLABEL")) { if (isempty(attr)) @@ -1129,13 +1129,13 @@ static int parse_token( op = OP_ASSIGN; } - r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr, /* is_case_insensitive = */ false, token_str); } else if (streq(key, "RUN")) { if (is_match || op == OP_REMOVE) return log_line_invalid_op(rule_line, key); check_value_format_and_warn(rule_line, key, value, true); if (!attr || streq(attr, "program")) - r = rule_line_add_token(rule_line, TK_A_RUN_PROGRAM, op, value, NULL, /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_RUN_PROGRAM, op, value, NULL, /* is_case_insensitive = */ false, token_str); else if (streq(attr, "builtin")) { UdevBuiltinCommand cmd; @@ -1143,7 +1143,7 @@ static int parse_token( if (cmd < 0) return log_line_error_errno(rule_line, SYNTHETIC_ERRNO(EINVAL), "Unknown builtin command '%s', ignoring.", value); - r = rule_line_add_token(rule_line, TK_A_RUN_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive= */ false, token_str); + r = rule_line_add_token(rule_line, TK_A_RUN_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd), /* is_case_insensitive = */ false, token_str); } else return log_line_invalid_attr(rule_line, key); } else if (streq(key, "GOTO")) { @@ -1799,7 +1799,7 @@ int udev_rules_load(UdevRules **ret_rules, ResolveNameTiming resolve_name_timing return -ENOMEM; } - r = strv_extend_strv(&directories, CONF_PATHS_STRV("udev/rules.d"), /* filter_duplicates= */ false); + r = strv_extend_strv(&directories, CONF_PATHS_STRV("udev/rules.d"), /* filter_duplicates = */ false); if (r < 0) return r; @@ -1808,7 +1808,7 @@ int udev_rules_load(UdevRules **ret_rules, ResolveNameTiming resolve_name_timing CLEANUP_ARRAY(files, n_files, conf_file_free_many); - r = conf_files_list_strv_full(".rules", /* root= */ NULL, CONF_FILES_REGULAR | CONF_FILES_FILTER_MASKED, + r = conf_files_list_strv_full(".rules", /* root = */ NULL, CONF_FILES_REGULAR | CONF_FILES_FILTER_MASKED, (const char* const*) directories, &files, &n_files); if (r < 0) return log_debug_errno(r, "Failed to enumerate rules files: %m"); @@ -1816,7 +1816,7 @@ int udev_rules_load(UdevRules **ret_rules, ResolveNameTiming resolve_name_timing FOREACH_ARRAY(i, files, n_files) { ConfFile *c = *i; - r = udev_rules_parse_file(rules, c, /* extra_checks= */ false, /* ret= */ NULL); + r = udev_rules_parse_file(rules, c, /* extra_checks = */ false, /* ret = */ NULL); if (r < 0) log_debug_errno(r, "Failed to read rules file '%s', ignoring: %m", c->original_path); } @@ -1832,7 +1832,7 @@ bool udev_rules_should_reload(UdevRules *rules) { if (!rules) return true; - r = config_get_stats_by_path(".rules", NULL, 0, RULES_DIRS, /* check_dropins= */ false, &stats_by_path); + r = config_get_stats_by_path(".rules", NULL, 0, RULES_DIRS, /* check_dropins = */ false, &stats_by_path); if (r < 0) { log_warning_errno(r, "Failed to get stats of udev rules, ignoring: %m"); return true; @@ -1881,7 +1881,7 @@ static bool apply_format_value( size_t result_size, const char *what) { - return apply_format_full(event, token, token->value, result, result_size, /* replace_whitespace= */ false, what); + return apply_format_full(event, token, token->value, result, result_size, /* replace_whitespace = */ false, what); } static bool apply_format_attr( @@ -1891,7 +1891,7 @@ static bool apply_format_attr( size_t result_size, const char *what) { - return apply_format_full(event, token, token->data, result, result_size, /* replace_whitespace= */ false, what); + return apply_format_full(event, token, token->data, result, result_size, /* replace_whitespace = */ false, what); } static bool token_match_string(UdevEvent *event, UdevRuleToken *token, const char *str, bool log_result) { @@ -2029,7 +2029,7 @@ static bool token_match_attr(UdevRuleToken *token, sd_device *dev, UdevEvent *ev value = delete_trailing_chars(vbuf, NULL); } - return token_match_string(event, token, value, /* log_result= */ true); + return token_match_string(event, token, value, /* log_result = */ true); case SUBST_TYPE_SUBSYS: r = udev_resolve_subsys_kernel(name, vbuf, sizeof(vbuf), true); @@ -2042,7 +2042,7 @@ static bool token_match_attr(UdevRuleToken *token, sd_device *dev, UdevEvent *ev if (FLAGS_SET(token->match_type, MATCH_REMOVE_TRAILING_WHITESPACE)) delete_trailing_chars(vbuf, NULL); - return token_match_string(event, token, vbuf, /* log_result= */ true); + return token_match_string(event, token, vbuf, /* log_result = */ true); default: assert_not_reached(); @@ -2207,7 +2207,7 @@ static int udev_rule_apply_token_to_event( if (r < 0) return log_event_error_errno(event, token, r, "Failed to get uevent action type: %m"); - return token_match_string(event, token, device_action_to_string(a), /* log_result= */ true); + return token_match_string(event, token, device_action_to_string(a), /* log_result = */ true); } case TK_M_DEVPATH: { const char *val; @@ -2216,7 +2216,7 @@ static int udev_rule_apply_token_to_event( if (r < 0) return log_event_error_errno(event, token, r, "Failed to get devpath: %m"); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_KERNEL: case TK_M_PARENTS_KERNEL: { @@ -2226,23 +2226,23 @@ static int udev_rule_apply_token_to_event( if (r < 0) return log_event_error_errno(event, token, r, "Failed to get sysname: %m"); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_DEVLINK: FOREACH_DEVICE_DEVLINK(dev, val) - if (token_match_string(event, token, strempty(startswith(val, "/dev/")), /* log_result= */ false) == (token->op == OP_MATCH)) + if (token_match_string(event, token, strempty(startswith(val, "/dev/")), /* log_result = */ false) == (token->op == OP_MATCH)) return log_event_result(event, token, token->op == OP_MATCH); return log_event_result(event, token, token->op == OP_NOMATCH); case TK_M_NAME: - return token_match_string(event, token, event->name, /* log_result= */ true); + return token_match_string(event, token, event->name, /* log_result = */ true); case TK_M_ENV: { const char *val = NULL; (void) device_get_property_value_with_fallback(dev, token->data, event->worker ? event->worker->properties : NULL, &val); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_CONST: { const char *val, *k = token->data; @@ -2255,12 +2255,12 @@ static int udev_rule_apply_token_to_event( val = confidential_virtualization_to_string(detect_confidential_virtualization()); else assert_not_reached(); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_TAG: case TK_M_PARENTS_TAG: FOREACH_DEVICE_CURRENT_TAG(dev, val) - if (token_match_string(event, token, val, /* log_result= */ false) == (token->op == OP_MATCH)) + if (token_match_string(event, token, val, /* log_result = */ false) == (token->op == OP_MATCH)) return log_event_result(event, token, token->op == OP_MATCH); return log_event_result(event, token, token->op == OP_NOMATCH); @@ -2274,7 +2274,7 @@ static int udev_rule_apply_token_to_event( else if (r < 0) return log_event_error_errno(event, token, r, "Failed to get subsystem: %m"); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_DRIVER: case TK_M_PARENTS_DRIVER: { @@ -2286,7 +2286,7 @@ static int udev_rule_apply_token_to_event( else if (r < 0) return log_event_error_errno(event, token, r, "Failed to get driver: %m"); - return token_match_string(event, token, val, /* log_result= */ true); + return token_match_string(event, token, val, /* log_result = */ true); } case TK_M_ATTR: case TK_M_PARENTS_ATTR: @@ -2303,7 +2303,7 @@ static int udev_rule_apply_token_to_event( if (r < 0 && r != -ENOENT) return log_event_error_errno(event, token, r, "Failed to read sysctl \"%s\": %m", buf); - return token_match_string(event, token, strstrip(value), /* log_result= */ true); + return token_match_string(event, token, strstrip(value), /* log_result = */ true); } case TK_M_TEST: { mode_t mode = PTR_TO_MODE(token->data); @@ -2359,7 +2359,7 @@ static int udev_rule_apply_token_to_event( log_event_debug(event, token, "Running command \"%s\"", buf); - r = udev_event_spawn(event, /* accept_failure= */ true, buf, result, sizeof(result), NULL); + r = udev_event_spawn(event, /* accept_failure = */ true, buf, result, sizeof(result), NULL); if (r != 0) { if (r < 0) log_event_warning_errno(event, token, r, "Failed to execute \"%s\": %m", buf); @@ -2432,7 +2432,7 @@ static int udev_rule_apply_token_to_event( log_event_debug(event, token, "Importing properties from results of \"%s\"", buf); - r = udev_event_spawn(event, /* accept_failure= */ true, buf, result, sizeof result, &truncated); + r = udev_event_spawn(event, /* accept_failure = */ true, buf, result, sizeof result, &truncated); if (r != 0) { if (r < 0) log_event_warning_errno(event, token, r, "Failed to execute \"%s\", ignoring: %m", buf); @@ -2588,7 +2588,7 @@ static int udev_rule_apply_token_to_event( return log_event_result(event, token, token->op == (have ? OP_MATCH : OP_NOMATCH)); } case TK_M_RESULT: - return token_match_string(event, token, event->program_result, /* log_result= */ true); + return token_match_string(event, token, event->program_result, /* log_result = */ true); case TK_A_OPTIONS_DUMP: { sd_json_format_flags_t flags = PTR_TO_UINT(token->data); @@ -2830,7 +2830,7 @@ static int udev_rule_apply_token_to_event( return true; if (event->esc == ESCAPE_REPLACE) - udev_replace_chars_and_log(event, token, p, /* allow= */ NULL, "property value"); + udev_replace_chars_and_log(event, token, p, /* allow = */ NULL, "property value"); r = device_add_property(dev, name, value_new); if (r < 0) @@ -2855,7 +2855,7 @@ static int udev_rule_apply_token_to_event( if (token->op == OP_ASSIGN) device_cleanup_tags(dev); - r = device_add_tag(dev, buf, /* both= */ true); + r = device_add_tag(dev, buf, /* both = */ true); if (r == -ENOMEM) return log_oom(); if (r < 0) @@ -2910,15 +2910,15 @@ static int udev_rule_apply_token_to_event( device_cleanup_devlinks(dev); if (!apply_format_full(event, token, token->value, buf, sizeof(buf), - /* replace_whitespace= */ event->esc != ESCAPE_NONE, + /* replace_whitespace = */ event->esc != ESCAPE_NONE, "symbolic link path")) return true; /* By default or string_escape=none, allow multiple symlinks separated by spaces. */ if (event->esc == ESCAPE_UNSET) - udev_replace_chars_and_log(event, token, buf, /* allow= */ "/ ", "device node symlink"); + udev_replace_chars_and_log(event, token, buf, /* allow = */ "/ ", "device node symlink"); else if (event->esc == ESCAPE_REPLACE) - udev_replace_chars_and_log(event, token, buf, /* allow= */ "/", "device node symlink"); + udev_replace_chars_and_log(event, token, buf, /* allow = */ "/", "device node symlink"); for (const char *p = buf;;) { _cleanup_free_ char *path = NULL; @@ -2992,7 +2992,7 @@ static int udev_rule_apply_token_to_event( /* Then, make the path relative again. This also checks if the path being inside of the sysfs. */ _cleanup_free_ char *resolved = NULL; _cleanup_close_ int fd = -EBADF; - r = device_chase(dev, buf, /* flags= */ 0, &resolved, &fd); + r = device_chase(dev, buf, /* flags = */ 0, &resolved, &fd); if (r < 0) { log_event_error_errno(event, token, r, "Could not chase sysfs attribute \"%s\", ignoring: %m", buf); return true; @@ -3026,7 +3026,7 @@ static int udev_rule_apply_token_to_event( if (!copied) return log_oom(); - r = device_cache_sysattr_value(dev, resolved, copied, /* error= */ 0); + r = device_cache_sysattr_value(dev, resolved, copied, /* error = */ 0); if (r < 0) log_event_warning_errno(event, token, r, "Failed to cache sysfs attribute \"%s\", ignoring: %m", resolved); else if (r > 0) { @@ -3064,7 +3064,7 @@ static int udev_rule_apply_token_to_event( if (!path) return log_oom(); - r = verify_regular_at(AT_FDCWD, path, /* follow= */ true); + r = verify_regular_at(AT_FDCWD, path, /* follow = */ true); if (r < 0 && !ERRNO_IS_NEG_PRIVILEGE(r)) log_event_error_errno(event, token, r, "Failed to verify sysctl entry \"%s\" is a regular file: %m", buf); else diff --git a/src/udev/udev-spawn.c b/src/udev/udev-spawn.c index 88ac5de3505..2cce2da02a5 100644 --- a/src/udev/udev-spawn.c +++ b/src/udev/udev-spawn.c @@ -391,7 +391,7 @@ void udev_event_execute_run(UdevEvent *event) { log_device_debug(event->dev, "Running command \"%s\"", command); - r = udev_event_spawn(event, /* accept_failure= */ false, command, NULL, 0, NULL); + r = udev_event_spawn(event, /* accept_failure = */ false, command, NULL, 0, NULL); if (r < 0) log_device_warning_errno(event->dev, r, "Failed to execute '%s', ignoring: %m", command); else if (r > 0) /* returned value is positive when program fails */ diff --git a/src/udev/udev-varlink.c b/src/udev/udev-varlink.c index 78bcc11fd4f..9a887d9c7f2 100644 --- a/src/udev/udev-varlink.c +++ b/src/udev/udev-varlink.c @@ -18,12 +18,12 @@ static int vl_method_reload(sd_varlink *link, sd_json_variant *parameters, sd_va assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; log_debug("Received io.systemd.service.Reload()"); - manager_reload(userdata, /* force= */ true); + manager_reload(userdata, /* force = */ true); return sd_varlink_reply(link, NULL); } @@ -112,7 +112,7 @@ static int vl_method_revert(sd_varlink *link, sd_json_variant *parameters, sd_va assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -128,7 +128,7 @@ static int vl_method_start_stop_exec_queue(sd_varlink *link, sd_json_variant *pa assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; @@ -154,7 +154,7 @@ static int vl_method_exit(sd_varlink *link, sd_json_variant *parameters, sd_varl assert(link); - r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL); + r = sd_varlink_dispatch(link, parameters, /* dispatch_table = */ NULL, /* userdata = */ NULL); if (r != 0) return r; diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index 76de67733f4..b28b7d5c2c2 100644 --- a/src/udev/udev-watch.c +++ b/src/udev/udev-watch.c @@ -230,7 +230,7 @@ static int manager_process_inotify(Manager *manager, const struct inotify_event if (FLAGS_SET(e->mask, IN_IGNORED)) { log_debug("Received inotify event about removal of watch handle %i.", e->wd); - r = udev_watch_clear_by_wd(/* dev= */ NULL, /* dirfd= */ -EBADF, e->wd); + r = udev_watch_clear_by_wd(/* dev = */ NULL, /* dirfd = */ -EBADF, e->wd); if (r < 0) log_warning_errno(r, "Failed to remove saved symlink(s) for watch handle %i, ignoring: %m", e->wd); @@ -612,11 +612,11 @@ static int notify_and_wait_signal(UdevWorker *worker, sd_device *dev, const char if (r < 0) return r; - r = sd_event_add_signal(e, /* ret= */ NULL, SIGUSR1 | SD_EVENT_SIGNAL_PROCMASK, on_sigusr1, worker); + r = sd_event_add_signal(e, /* ret = */ NULL, SIGUSR1 | SD_EVENT_SIGNAL_PROCMASK, on_sigusr1, worker); if (r < 0) return r; - r = sd_notify(/* unset_environment= */ false, msg); + r = sd_notify(/* unset_environment = */ false, msg); if (r <= 0) return r; diff --git a/src/udev/udev-worker.c b/src/udev/udev-worker.c index 67617203d76..27addfa7f10 100644 --- a/src/udev/udev-worker.c +++ b/src/udev/udev-worker.c @@ -127,7 +127,7 @@ static int worker_lock_whole_disk(UdevWorker *worker, sd_device *dev, int *ret_f log_device_debug_errno(dev, errno, "Block device %s is currently locked, requeuing the event.", whole_disk); - r = sd_notifyf(/* unset_environment= */ false, "TRY_AGAIN=1\nWHOLE_DISK=%s", whole_disk); + r = sd_notifyf(/* unset_environment = */ false, "TRY_AGAIN=1\nWHOLE_DISK=%s", whole_disk); if (r < 0) { log_device_warning_errno(dev, r, "Failed to send notification message to manager process: %m"); (void) sd_event_exit(worker->event, r); @@ -267,7 +267,7 @@ static int worker_process_device(UdevWorker *worker, sd_device *dev) { return 0; } - r = sd_notify(/* unset_environment= */ false, "PROCESSED=1"); + r = sd_notify(/* unset_environment = */ false, "PROCESSED=1"); if (r < 0) { log_device_warning_errno(dev, r, "Failed to send notification message to manager process: %m"); (void) sd_event_exit(worker->event, r); @@ -297,7 +297,7 @@ static int worker_device_monitor_handler(sd_device_monitor *monitor, sd_device * } const char *e = errno_name_no_fallback(r); - r = sd_notifyf(/* unset_environment= */ false, "ERRNO=%i%s%s", -r, e ? "\nERRNO_NAME=" : "", strempty(e)); + r = sd_notifyf(/* unset_environment = */ false, "ERRNO=%i%s%s", -r, e ? "\nERRNO_NAME=" : "", strempty(e)); if (r < 0) { log_device_warning_errno(dev, r, "Failed to send notification message to manager process, ignoring: %m"); (void) sd_event_exit(worker->event, r); diff --git a/src/udev/udevadm-cat.c b/src/udev/udevadm-cat.c index c77e76d0538..8039a44b8cb 100644 --- a/src/udev/udevadm-cat.c +++ b/src/udev/udevadm-cat.c @@ -112,5 +112,5 @@ int cat_main(int argc, char *argv[], void *userdata) { return r; /* udev rules file does not support dropin configs. So, we can safely pass multiple files as dropins. */ - return cat_files_full(/* file= */ NULL, files, n_files, arg_cat_flags); + return cat_files_full(/* file = */ NULL, files, n_files, arg_cat_flags); } diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c index 492b00f222b..c49524a4fea 100644 --- a/src/udev/udevadm-control.c +++ b/src/udev/udevadm-control.c @@ -273,16 +273,16 @@ static int send_control_commands(void) { return log_error_errno(r, "Failed to connect to udev via varlink: %m"); if (arg_exit) - return varlink_call_and_log(link, "io.systemd.Udev.Exit", /* parameters= */ NULL, /* reply= */ NULL); + return varlink_call_and_log(link, "io.systemd.Udev.Exit", /* parameters = */ NULL, /* reply = */ NULL); if (arg_revert) { - r = varlink_call_and_log(link, "io.systemd.Udev.Revert", /* parameters= */ NULL, /* reply= */ NULL); + r = varlink_call_and_log(link, "io.systemd.Udev.Revert", /* parameters = */ NULL, /* reply = */ NULL); if (r < 0) return r; } if (arg_log_level >= 0) { - r = varlink_callbo_and_log(link, "io.systemd.service.SetLogLevel", /* reply= */ NULL, + r = varlink_callbo_and_log(link, "io.systemd.service.SetLogLevel", /* reply = */ NULL, SD_JSON_BUILD_PAIR_INTEGER("level", arg_log_level)); if (r < 0) return r; @@ -290,39 +290,39 @@ static int send_control_commands(void) { if (arg_start_exec_queue >= 0) { r = varlink_call_and_log(link, arg_start_exec_queue ? "io.systemd.Udev.StartExecQueue" : "io.systemd.Udev.StopExecQueue", - /* parameters= */ NULL, /* reply= */ NULL); + /* parameters = */ NULL, /* reply = */ NULL); if (r < 0) return r; } if (arg_reload) { - r = varlink_call_and_log(link, "io.systemd.service.Reload", /* parameters= */ NULL, /* reply= */ NULL); + r = varlink_call_and_log(link, "io.systemd.service.Reload", /* parameters = */ NULL, /* reply = */ NULL); if (r < 0) return r; } if (!strv_isempty(arg_env)) { - r = varlink_callbo_and_log(link, "io.systemd.Udev.SetEnvironment", /* reply= */ NULL, + r = varlink_callbo_and_log(link, "io.systemd.Udev.SetEnvironment", /* reply = */ NULL, SD_JSON_BUILD_PAIR_STRV("assignments", arg_env)); if (r < 0) return r; } if (arg_max_children >= 0) { - r = varlink_callbo_and_log(link, "io.systemd.Udev.SetChildrenMax", /* reply= */ NULL, + r = varlink_callbo_and_log(link, "io.systemd.Udev.SetChildrenMax", /* reply = */ NULL, SD_JSON_BUILD_PAIR_UNSIGNED("number", arg_max_children)); if (r < 0) return r; } if (arg_ping) { - r = varlink_call_and_log(link, "io.systemd.service.Ping", /* parameters= */ NULL, /* reply= */ NULL); + r = varlink_call_and_log(link, "io.systemd.service.Ping", /* parameters = */ NULL, /* reply = */ NULL); if (r < 0) return r; } if (arg_trace >= 0) { - r = varlink_callbo_and_log(link, "io.systemd.Udev.SetTrace", /* reply= */ NULL, + r = varlink_callbo_and_log(link, "io.systemd.Udev.SetTrace", /* reply = */ NULL, SD_JSON_BUILD_PAIR_BOOLEAN("enable", arg_trace)); if (r < 0) return r; diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 6db63a1693c..e3bc4c4858b 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -210,12 +210,12 @@ static int print_device_chain(sd_device *device) { "and the attributes from one single parent device.\n" "\n"); - r = print_all_attributes(device, /* is_parent= */ false); + r = print_all_attributes(device, /* is_parent = */ false); if (r < 0) return r; for (child = device; sd_device_get_parent(child, &parent) >= 0; child = parent) { - r = print_all_attributes(parent, /* is_parent= */ true); + r = print_all_attributes(parent, /* is_parent = */ true); if (r < 0) return r; } @@ -313,12 +313,12 @@ static int print_device_chain_in_json(sd_device *device) { arg_json_format_flags |=SD_JSON_FORMAT_SEQ; - r = print_all_attributes_in_json(device, /* is_parent= */ false); + r = print_all_attributes_in_json(device, /* is_parent = */ false); if (r < 0) return r; for (child = device; sd_device_get_parent(child, &parent) >= 0; child = parent) { - r = print_all_attributes_in_json(parent, /* is_parent= */ true); + r = print_all_attributes_in_json(parent, /* is_parent = */ true); if (r < 0) return r; } @@ -1302,7 +1302,7 @@ int info_main(int argc, char *argv[], void *userdata) { STRV_FOREACH(p, arg_devices) { _cleanup_(sd_device_unrefp) sd_device *device = NULL; - r = find_device(*p, /* prefix= */ NULL, &device); + r = find_device(*p, /* prefix = */ NULL, &device); if (r < 0) { if (r == -EINVAL) log_error_errno(r, "Bad argument \"%s\", expected an absolute path in /dev/ or /sys/, device ID, or a unit name: %m", *p); diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 19128ec80e7..ff9cd5f02c0 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -130,7 +130,7 @@ static int emit_deprecation_warning(void) { NULL, &b); - r = strv_extend_strv_consume(&a, TAKE_PTR(b), /* filter_duplicates= */ true); + r = strv_extend_strv_consume(&a, TAKE_PTR(b), /* filter_duplicates = */ true); if (r < 0) return r; } @@ -200,7 +200,7 @@ int settle_main(int argc, char *argv[], void *userdata) { (void) emit_deprecation_warning(); if (getuid() == 0) { - r = udev_ping(MAX(5 * USEC_PER_SEC, arg_timeout_usec), /* ignore_connection_failure= */ true); + r = udev_ping(MAX(5 * USEC_PER_SEC, arg_timeout_usec), /* ignore_connection_failure = */ true); if (r <= 0) return r; } else { diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index 06d9d2cd16f..6380aec36df 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -81,7 +81,7 @@ static int parse_argv(int argc, char *argv[]) { case 'D': { _cleanup_free_ char *p = NULL; - r = parse_path_argument(optarg, /* suppress_root= */ false, &p); + r = parse_path_argument(optarg, /* suppress_root = */ false, &p); if (r < 0) return r; diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 10f8a15fb17..cfc157ce279 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -221,7 +221,7 @@ static int setup_matches(sd_device_enumerator *e) { assert(e); STRV_FOREACH(d, arg_devices) { - r = add_device_match(e, *d, /* prefix= */ NULL); + r = add_device_match(e, *d, /* prefix = */ NULL); if (r < 0) return r; } @@ -563,7 +563,7 @@ int trigger_main(int argc, char *argv[], void *userdata) { return r; if (arg_ping) { - r = udev_ping(arg_ping_timeout_usec, /* ignore_connection_failure= */ false); + r = udev_ping(arg_ping_timeout_usec, /* ignore_connection_failure = */ false); if (r < 0) return r; assert(r > 0); diff --git a/src/udev/udevadm-util.c b/src/udev/udevadm-util.c index a171060471a..48c04aca5a5 100644 --- a/src/udev/udevadm-util.c +++ b/src/udev/udevadm-util.c @@ -213,7 +213,7 @@ int udev_ping(usec_t timeout_usec, bool ignore_connection_failure) { if (r < 0) return log_error_errno(r, "Failed to connect to udev via varlink: %m"); - r = varlink_call_and_log(link, "io.systemd.service.Ping", /* parameters= */ NULL, /* reply= */ NULL); + r = varlink_call_and_log(link, "io.systemd.service.Ping", /* parameters = */ NULL, /* reply = */ NULL); if (r < 0) return r; diff --git a/src/udev/udevadm-verify.c b/src/udev/udevadm-verify.c index 7918ea2f7e7..15406357b5e 100644 --- a/src/udev/udevadm-verify.c +++ b/src/udev/udevadm-verify.c @@ -108,7 +108,7 @@ static int verify_rules_file(UdevRules *rules, const ConfFile *c) { assert(rules); assert(c); - r = udev_rules_parse_file(rules, c, /* extra_checks= */ true, &file); + r = udev_rules_parse_file(rules, c, /* extra_checks = */ true, &file); if (r < 0) return log_error_errno(r, "Failed to parse rules file %s: %m", c->original_path); diff --git a/src/update-done/update-done.c b/src/update-done/update-done.c index c50acca0452..3e5dfd29eee 100644 --- a/src/update-done/update-done.c +++ b/src/update-done/update-done.c @@ -138,7 +138,7 @@ static int run(int argc, char *argv[]) { r = chase_and_stat("/usr", arg_root, CHASE_PREFIX_ROOT | CHASE_WARN | CHASE_MUST_BE_DIRECTORY, - /* ret_path= */ NULL, + /* ret_path = */ NULL, &st); if (r < 0) return log_error_errno(r, "Failed to stat %s/usr/: %m", strempty(arg_root)); diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c index 99d32290fe2..c0df726fe49 100644 --- a/src/userdb/userdbctl.c +++ b/src/userdb/userdbctl.c @@ -525,7 +525,7 @@ static int display_user(int argc, char *argv[], void *userdata) { if (arg_boundaries) { _cleanup_(uid_range_freep) UIDRange *uid_range = NULL; - r = uid_range_load_userns(/* path= */ NULL, UID_RANGE_USERNS_INSIDE, &uid_range); + r = uid_range_load_userns(/* path = */ NULL, UID_RANGE_USERNS_INSIDE, &uid_range); if (r < 0) log_debug_errno(r, "Failed to load /proc/self/uid_map, ignoring: %m"); @@ -865,7 +865,7 @@ static int display_group(int argc, char *argv[], void *userdata) { if (arg_boundaries) { _cleanup_(uid_range_freep) UIDRange *gid_range = NULL; - r = uid_range_load_userns(/* path= */ NULL, GID_RANGE_USERNS_INSIDE, &gid_range); + r = uid_range_load_userns(/* path = */ NULL, GID_RANGE_USERNS_INSIDE, &gid_range); if (r < 0) log_debug_errno(r, "Failed to load /proc/self/gid_map, ignoring: %m"); @@ -1488,7 +1488,7 @@ static int load_credential_one( return log_error_errno(errno, "Failed to chown %s: %m", hd); r = copy_tree(user_record_skeleton_directory(ur), hd, ur->uid, user_record_gid(ur), - COPY_REFLINK|COPY_MERGE, /* denylist= */ NULL, /* subvolumes= */ NULL); + COPY_REFLINK|COPY_MERGE, /* denylist= */ NULL, /* subvolumes= */NULL); if (r < 0 && r != -ENOENT) return log_error_errno(r, "Failed to copy skeleton directory to %s: %m", hd); } @@ -1710,7 +1710,7 @@ static int parse_argv(int argc, char *argv[]) { if (isempty(optarg)) arg_services = strv_free(arg_services); else { - r = strv_split_and_extend(&arg_services, optarg, ":", /* filter_duplicates= */ true); + r = strv_split_and_extend(&arg_services, optarg, ":", /* filter_duplicates = */ true); if (r < 0) return log_error_errno(r, "Failed to parse -s/--service= argument: %m"); } diff --git a/src/userdb/userdbd-manager.c b/src/userdb/userdbd-manager.c index b3b7acec581..91fa09d3166 100644 --- a/src/userdb/userdbd-manager.c +++ b/src/userdb/userdbd-manager.c @@ -59,7 +59,7 @@ static int on_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, voi assert(s); - (void) start_workers(m, /* explicit_request= */ true); /* Workers told us there's more work, let's add one more worker as long as we are below the high watermark */ + (void) start_workers(m, /* explicit_request=*/ true); /* Workers told us there's more work, let's add one more worker as long as we are below the high watermark */ return 0; } @@ -70,7 +70,7 @@ static int on_deferred_start_worker(sd_event_source *s, uint64_t usec, void *use m->deferred_start_worker_event_source = sd_event_source_unref(m->deferred_start_worker_event_source); - (void) start_workers(m, /* explicit_request= */ false); + (void) start_workers(m, /* explicit_request=*/ false); return 0; } diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 52ed833948a..75d6c21e282 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -1330,12 +1330,12 @@ static int start_systemd_journal_remote( _cleanup_free_ char *sd_journal_remote = NULL; r = find_executable_full( "systemd-journal-remote", - /* root= */ NULL, + /* root = */ NULL, STRV_MAKE(LIBEXECDIR), - /* use_path_envvar= */ true, /* systemd-journal-remote should be installed in + /* use_path_envvar = */ true, /* systemd-journal-remote should be installed in * LIBEXECDIR, but for supporting fancy setups. */ &sd_journal_remote, - /* ret_fd= */ NULL); + /* ret_fd = */ NULL); if (r < 0) return log_error_errno(r, "Failed to find systemd-journal-remote binary: %m"); @@ -2288,7 +2288,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { return r; } - assert_se(sigprocmask_many(SIG_BLOCK, /* ret_old_mask= */ NULL, SIGCHLD) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, /* ret_old_mask=*/ NULL, SIGCHLD) >= 0); _cleanup_(sd_event_unrefp) sd_event *event = NULL; r = sd_event_new(&event); @@ -2705,7 +2705,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, - /* separators= */ 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"); @@ -2719,7 +2719,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { log_debug("Executing: %s", joined); } - assert_se(sigprocmask_many(SIG_BLOCK, /* ret_old_mask= */ NULL, SIGCHLD) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, /* ret_old_mask=*/ NULL, SIGCHLD) >= 0); _cleanup_(pidref_done) PidRef child_pidref = PIDREF_NULL; r = pidref_safe_fork_full( @@ -2897,7 +2897,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { } else if (!isempty(arg_background)) (void) pty_forward_set_background_color(forward, arg_background); - (void) pty_forward_set_window_title(forward, GLYPH_GREEN_CIRCLE, /* hostname= */ NULL, + (void) pty_forward_set_window_title(forward, GLYPH_GREEN_CIRCLE, /* hostname = */ NULL, STRV_MAKE("Virtual Machine", arg_machine)); } diff --git a/src/volatile-root/volatile-root.c b/src/volatile-root/volatile-root.c index 883f193ff44..4febb162bdc 100644 --- a/src/volatile-root/volatile-root.c +++ b/src/volatile-root/volatile-root.c @@ -157,7 +157,7 @@ static int run(int argc, char *argv[]) { if (!IN_SET(m, VOLATILE_YES, VOLATILE_OVERLAY)) return 0; - r = path_is_mount_point_full(path, /* root= */ NULL, AT_SYMLINK_FOLLOW); + r = path_is_mount_point_full(path, /* root = */ NULL, AT_SYMLINK_FOLLOW); if (r < 0) return log_error_errno(r, "Couldn't determine whether %s is a mount point: %m", path); if (r == 0) diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c index 62ddce1815e..8a752c81009 100644 --- a/src/xdg-autostart-generator/xdg-autostart-service.c +++ b/src/xdg-autostart-generator/xdg-autostart-service.c @@ -606,7 +606,7 @@ int xdg_autostart_service_generate_unit( if (!path_escaped) return log_oom(); - r = generator_open_unit_file(dest, /* source= */ NULL, service->name, &f); + r = generator_open_unit_file(dest, /* source = */ NULL, service->name, &f); if (r < 0) return r;