From 4730b89323e190353f4f5629632da3bde10367e5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 27 Apr 2013 07:13:50 +0000 Subject: Do not label swap devices as mountable or containing a filesystem --- tdecore/tdehardwaredevices.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tdecore') diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 8cf86d721..1b7a2c8ac 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -4311,7 +4311,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable; } - if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (!filesystemtype.isNull())) { + if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP") && (!filesystemtype.isNull())) { diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem; } @@ -4328,6 +4328,10 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable; } } + // Swap partitions cannot be mounted + if (filesystemtype.upper() == "SWAP") { + diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable; + } // If certain disk types do not report the presence of a filesystem, they are likely not mountable if ((disktype & TDEDiskDeviceType::HDD) || (disktype & TDEDiskDeviceType::Optical)) { if (!(diskstatus & TDEDiskDeviceStatus::ContainsFilesystem)) { -- cgit v1.2.1