tree-wide: normalize comment style
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 */
|
||||
}
|
||||
|
||||
@@ -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, \
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
+10
-10
@@ -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;
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 "-";
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -56,11 +56,10 @@ 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,
|
||||
@@ -125,7 +124,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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+11
-11
@@ -850,8 +850,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 +861,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 +1203,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 +1362,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 +1798,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");
|
||||
|
||||
@@ -1998,7 +1998,7 @@ int fsmount_credentials_fs(int *ret_fsfd) {
|
||||
return -errno;
|
||||
|
||||
int mfd = fsmount(fs_fd, FSMOUNT_CLOEXEC,
|
||||
ms_flags_to_mount_attr(credentials_fs_mount_flags(/* ro = */ false)));
|
||||
ms_flags_to_mount_attr(credentials_fs_mount_flags(/* ro= */ false)));
|
||||
if (mfd < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -2013,7 +2013,7 @@ int mount_credentials_fs(const char *path) {
|
||||
|
||||
assert(path);
|
||||
|
||||
mfd = fsmount_credentials_fs(/* ret_fsfd = */ NULL);
|
||||
mfd = fsmount_credentials_fs(/* ret_fsfd= */ NULL);
|
||||
if (mfd < 0)
|
||||
return mfd;
|
||||
|
||||
@@ -2158,7 +2158,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 +2225,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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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 */
|
||||
|
||||
|
||||
@@ -7015,7 +7015,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)
|
||||
@@ -8060,7 +8060,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user