]> git.ipfire.org Git - pakfire.git/commitdiff
execute: Log errors when cgroup could not be created
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 May 2021 11:57:41 +0000 (11:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 May 2021 11:57:41 +0000 (11:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/cgroup.c
src/libpakfire/execute.c

index a5857581f3a61343261b8a19f70015a3eecc1aee..e2ada6aa7af40b20e84170a007a69e41034b12e4 100644 (file)
@@ -255,8 +255,10 @@ static int pakfire_cgroup_enable_controllers(Pakfire pakfire,
 
 int pakfire_cgroup_create(Pakfire pakfire, const char* group) {
        int supported = pakfire_cgroup_supported(pakfire);
-       if (!supported)
+       if (!supported) {
+               errno = ENOTSUP;
                return 1;
+       }
 
        // Ensure that parent groups exist
        char* parent = pakfire_cgroup_parent_name(group);
index db8036399fa5f95bace0d729855d97d9fb2c640d..5c91f078ecf6656ea95b11854b4d365b7427e883 100644 (file)
@@ -398,8 +398,10 @@ PAKFIRE_EXPORT int pakfire_execute(Pakfire pakfire, const char* argv[], char* en
 
        // Create cgroup
        r = pakfire_cgroup_create(pakfire, env.cgroup);
-       if (r)
+       if (r) {
+               ERROR(pakfire, "Could not create cgroup %s: %s\n", env.cgroup, strerror(errno));
                goto ERROR;
+       }
 
        // Launch the new process straight into their cgroup
        cgroupdir = pakfire_cgroup_opendir(pakfire, env.cgroup);