]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup-util: use RET_NERRNO where appropriate
authorMike Yuan <me@yhndnzj.com>
Wed, 27 Nov 2024 17:37:46 +0000 (18:37 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 27 Nov 2024 17:38:00 +0000 (18:38 +0100)
src/basic/cgroup-util.c

index 8b1e051d56264ecd04168fe6580b72de79de1e0e..309dccb45ab22e89222c0dc7ee9a4cdc57ed2d76 100644 (file)
@@ -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) {