summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-07-23 22:26:19 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-08-16 21:55:17 -0400
commit2bea0592d696b74a16a817f952505f814395d6be (patch)
tree032ad122acbc499981fb6721a8ac06bf50c07bc5
parent81190bdbc5c98f0e1ffaad990fe520fd6ec4f203 (diff)
nspawn: Rename chown_cgroup_path → cgdir_chown
-rw-r--r--src/nspawn/nspawn-cgroup.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c
index b6f1323f21..8072ae4651 100644
--- a/src/nspawn/nspawn-cgroup.c
+++ b/src/nspawn/nspawn-cgroup.c
@@ -100,7 +100,8 @@ static int cgfile_get_cgroup(FILE *cgfile, const char *opts, char **ret_cgroup)
}
}
-static int chown_cgroup_path(const char *path, uid_t uid_shift) {
+static int cgdir_chown(const char *path, uid_t uid_shift) {
+
_cleanup_close_ int fd = -1;
const char *fn;
@@ -140,7 +141,7 @@ static int chown_cgroup(pid_t pid, CGroupUnified inner_cgver, uid_t uid_shift) {
if (r < 0)
return log_error_errno(r, "Failed to get file system path for container cgroup: %m");
- r = chown_cgroup_path(fs, uid_shift);
+ r = cgdir_chown(fs, uid_shift);
if (r < 0)
return log_error_errno(r, "Failed to chown() cgroup %s: %m", fs);
@@ -152,7 +153,7 @@ static int chown_cgroup(pid_t pid, CGroupUnified inner_cgver, uid_t uid_shift) {
if (r < 0)
return log_error_errno(r, "Failed to get file system path for container cgroup: %m");
- r = chown_cgroup_path(lfs, uid_shift);
+ r = cgdir_chown(lfs, uid_shift);
if (r < 0)
return log_error_errno(r, "Failed to chown() cgroup %s: %m", lfs);
}
@@ -208,7 +209,7 @@ static int sync_cgroup(pid_t pid, CGroupUnified outer_cgver, CGroupUnified inner
}
fn = strjoina(mountpoint, cgroup);
- r = chown_cgroup_path(fn, uid_shift);
+ r = cgdir_chown(fn, uid_shift);
if (r < 0)
log_error_errno(r, "Failed to chown() cgroup %s: %m", fn);
finish: