]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: remove empty cgroups (#7457)
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 24 Nov 2017 20:05:16 +0000 (21:05 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 24 Nov 2017 20:05:16 +0000 (21:05 +0100)
When we skip an unwritable cgroup also remove the empty mountpoint.

src/core/mount-setup.c

index 86b25424b27074c9e778a17818ab6382f39115f6..d5c0fcddcb120f4ef6a5d111f3feea86cb35915f 100644 (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;
                 }
         }