core: remove empty cgroups (#7457)

When we skip an unwritable cgroup also remove the empty mountpoint.
This commit is contained in:
Christian Brauner 2017-11-24 21:05:16 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 64b21ece8c
commit 1ff654e28b

View file

@ -208,6 +208,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
r = access(p->where, W_OK);
if (r < 0) {
(void) umount(p->where);
(void) rmdir(p->where);
return (p->mode & MNT_FATAL) ? r : 0;
}
}