The is_loopdev() and loopdev_has_backing_file() functions from
loopdev.h are Linux-specific. Guard the loop device cache cleanup
in blkid_gc_cache() with __linux__ to allow compilation on
non-Linux systems like GNU/Hurd.
Co-authored-by: Samuel Thibault <samuel.thibault@aquilenet.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
DBG(CACHE, ul_debugobj(cache, "freeing non-existing %s", dev->bid_name));
blkid_free_dev(dev);
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
+
+#ifdef __linux__
} else if (is_loopdev(dev->bid_name)
&& !loopdev_has_backing_file(dev->bid_name)) {
/* remove empty loop device from cache */
DBG(CACHE, ul_debugobj(cache, "freeing empty loop device %s", dev->bid_name));
blkid_free_dev(dev);
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
+#endif
} else {
DBG(CACHE, ul_debug("Device %s exists", dev->bid_name));
}