]> git.ipfire.org Git - pakfire.git/commitdiff
cgroups: Use the correct function to retrieve the path
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Dec 2024 14:30:18 +0000 (14:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Dec 2024 14:30:18 +0000 (14:30 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/cgroup.c

index 0a6f0bed266744481d085e1eb700773546644488..e0280a9dccc11e1844ddb40b385b9c560d7d43ee 100644 (file)
@@ -177,7 +177,7 @@ static int __pakfire_cgroup_open(struct pakfire_cgroup* cgroup) {
        // Try opening the cgroup
        fd = openat(cgroup->parent->fd, cgroup->name, O_DIRECTORY|O_PATH|O_CLOEXEC);
        if (fd < 0) {
-               ERROR(cgroup->ctx, "Could not open cgroup %s: %m\n", cgroup->path);
+               ERROR(cgroup->ctx, "Could not open cgroup %s: %m\n", pakfire_cgroup_path(cgroup));
                return -errno;
        }
 
@@ -240,7 +240,7 @@ static int pakfire_cgroup_write(struct pakfire_cgroup* cgroup,
        // Open the file
        fd = openat(cgroup->fd, path, O_WRONLY|O_CLOEXEC);
        if (fd < 0) {
-               DEBUG(cgroup->ctx, "Could not open %s/%s for writing: %m\n", cgroup->path, path);
+               DEBUG(cgroup->ctx, "Could not open %s/%s for writing: %m\n", pakfire_cgroup_path(cgroup), path);
                r = -errno;
                goto ERROR;
        }
@@ -252,7 +252,7 @@ static int pakfire_cgroup_write(struct pakfire_cgroup* cgroup,
 
        // Check if content was written okay
        if (bytes_written < 0) {
-               DEBUG(cgroup->ctx, "Could not write to %s/%s: %m\n", cgroup->path, path);
+               DEBUG(cgroup->ctx, "Could not write to %s/%s: %m\n", pakfire_cgroup_path(cgroup), path);
                r = -errno;
                goto ERROR;
        }
@@ -521,7 +521,7 @@ int pakfire_cgroup_destroy(struct pakfire_cgroup* cgroup) {
        // Delete the directory
        r = unlinkat(cgroup->parent->fd, cgroup->name, AT_REMOVEDIR);
        if (r) {
-               ERROR(cgroup->ctx, "Could not destroy cgroup %s: %m\n", cgroup->path);
+               ERROR(cgroup->ctx, "Could not destroy cgroup %s: %m\n", pakfire_cgroup_path(cgroup));
                return -errno;
        }