]> git.ipfire.org Git - pakfire.git/commitdiff
snapshots: Destroy directories after umount
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Oct 2024 13:47:43 +0000 (13:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Oct 2024 13:47:43 +0000 (13:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/snapshot.c

index 2be0f54cbafd669bf650f2823e65d496481cc30c..6b13ed26ff71ff0f99110c2506f185c8f0bbf3cf 100644 (file)
@@ -334,6 +334,10 @@ int pakfire_snapshot_umount(struct pakfire_snapshot* snapshot) {
                r = umount(snapshot->overlayfs.path);
                if (r < 0)
                        return r;
+
+               r = pakfire_rmtree(snapshot->overlayfs.path, 0);
+               if (r < 0)
+                       return r;
        }
 
        // Umount the tmpfs
@@ -341,6 +345,10 @@ int pakfire_snapshot_umount(struct pakfire_snapshot* snapshot) {
                r = umount(snapshot->tmpfs.path);
                if (r < 0)
                        return r;
+
+               r = pakfire_rmtree(snapshot->tmpfs.path, 0);
+               if (r < 0)
+                       return r;
        }
 
        return 0;