tree-wide: normalize comment style
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
+11
-11
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user