mount: failure to mount cgroup hierarchies should not be fatal

If we cannot open /etc/cgroup, print an error message, but go on, to
support cgroup-less builds.

https://bugzilla.redhat.com/show_bug.cgi?id=628004
This commit is contained in:
Lennart Poettering 2011-04-26 21:12:36 +02:00
parent 4db6d587c3
commit 016e9849e0

View file

@ -136,8 +136,10 @@ static int mount_cgroup_controllers(void) {
/* Mount all available cgroup controllers that are built into the kernel. */
if (!(f = fopen("/proc/cgroups", "re")))
return -ENOENT;
if (!(f = fopen("/proc/cgroups", "re"))) {
log_error("Failed to enumerate cgroup controllers: %m");
return 0;
}
/* Ignore the header line */
(void) fgets(buf, sizeof(buf), f);