Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.event_name == 'pull_request'

- name: Label PR based on policy in labeler.yml
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b
if: startsWith(github.event_name, 'pull_request') && github.base_ref == 'main' && github.event.action != 'closed'
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
2 changes: 1 addition & 1 deletion src/analyze/analyze-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &times);
n = acquire_time_data(bus, /* require_finished = */ false, &times);
if (n <= 0)
return n;

Expand Down
34 changes: 17 additions & 17 deletions src/analyze/analyze-condition.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -41,24 +41,24 @@ 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))
callback = config_parse_unit_condition_path;
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)
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/analyze/analyze-critical-chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand All @@ -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, &times);
n = acquire_time_data(bus, /* require_finished = */ true, &times);
if (n <= 0)
return n;

Expand Down
2 changes: 1 addition & 1 deletion src/analyze/analyze-fdstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/analyze/analyze-pcrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/analyze/analyze-plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -497,7 +497,7 @@ int verb_plot(int argc, char *argv[], void *userdata) {
return n;
}

n = acquire_time_data(bus, /* require_finished= */ true, &times);
n = acquire_time_data(bus, /* require_finished = */ true, &times);
if (n <= 0)
return n;

Expand Down
12 changes: 6 additions & 6 deletions src/analyze/analyze-security.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand All @@ -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);
}
2 changes: 1 addition & 1 deletion src/analyze/analyze-time-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/analyze/analyze-unit-gdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/analyze/analyze-verify-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
14 changes: 7 additions & 7 deletions src/backlight/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -233,19 +233,19 @@ 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");

r = sd_device_enumerator_add_nomatch_sysname(enumerate, sysname);
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");

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/basic/build-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions src/basic/cgroup-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/basic/chase.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading
Loading