static void pakfire_free(Pakfire pakfire) {
DEBUG(pakfire, "Releasing Pakfire at %p\n", pakfire);
- if (pakfire->destroy_on_free) {
+ if (pakfire->destroy_on_free && *pakfire->path) {
DEBUG(pakfire, "Destroying %s\n", pakfire->path);
+ // Umount the temporary file system
+ umount(pakfire->path);
+
+ // Destroy the temporary directory
pakfire_rmtree(pakfire->path, 0);
}
// Destroy everything when done
p->destroy_on_free = 1;
+
+ // Mount tmpfs
+ r = mount("pakfire_root", path, "tmpfs", 0, NULL);
+ if (r)
+ goto ERROR;
}
// Set path