summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-11-27 18:37:46 +0100
committerMike Yuan <me@yhndnzj.com>2024-11-27 18:38:00 +0100
commit4da9f38de11295539315abdb61c278d51bbe293d (patch)
tree53d2ab797c46d2be377c188982e6d42db6697645
parentnspawn: make sure --private-users-ownership=no and =off work the same way (diff)
downloadsystemd-4da9f38de11295539315abdb61c278d51bbe293d.tar.xz
systemd-4da9f38de11295539315abdb61c278d51bbe293d.zip
cgroup-util: use RET_NERRNO where appropriate
-rw-r--r--src/basic/cgroup-util.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 8b1e051d56..309dccb45a 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -65,11 +65,7 @@ int cg_cgroupid_open(int cgroupfs_fd, uint64_t id) {
cg_file_handle fh = CG_FILE_HANDLE_INIT;
CG_FILE_HANDLE_CGROUPID(fh) = id;
- int fd = open_by_handle_at(cgroupfs_fd, &fh.file_handle, O_DIRECTORY|O_CLOEXEC);
- if (fd < 0)
- return -errno;
-
- return fd;
+ return RET_NERRNO(open_by_handle_at(cgroupfs_fd, &fh.file_handle, O_DIRECTORY|O_CLOEXEC));
}
static int cg_enumerate_items(const char *controller, const char *path, FILE **ret, const char *item) {