From: Michael Tremer Date: Thu, 13 May 2021 11:57:41 +0000 (+0000) Subject: execute: Log errors when cgroup could not be created X-Git-Tag: 0.9.28~1285^2~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e2c22233e1c31ff961f307a9be8361bc7773dda;p=pakfire.git execute: Log errors when cgroup could not be created Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/cgroup.c b/src/libpakfire/cgroup.c index a5857581f..e2ada6aa7 100644 --- a/src/libpakfire/cgroup.c +++ b/src/libpakfire/cgroup.c @@ -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); diff --git a/src/libpakfire/execute.c b/src/libpakfire/execute.c index db8036399..5c91f078e 100644 --- a/src/libpakfire/execute.c +++ b/src/libpakfire/execute.c @@ -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);