From 4da9f38de11295539315abdb61c278d51bbe293d Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 27 Nov 2024 18:37:46 +0100 Subject: [PATCH] cgroup-util: use RET_NERRNO where appropriate --- src/basic/cgroup-util.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 8b1e051d562..309dccb45ab 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) { -- 2.47.3