summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorKarel Zak2008-04-15 23:18:36 +0200
committerKarel Zak2008-04-15 23:18:36 +0200
commit6cf644cf06468a90729e6c757497355a1feee743 (patch)
treefdf7637c33762ac517cba3a0e1b5dd85cd2ee651 /mount/swapon.c
parentmount: fix typo in mount.8 (diff)
downloadkernel-qcow2-util-linux-6cf644cf06468a90729e6c757497355a1feee743.tar.gz
kernel-qcow2-util-linux-6cf644cf06468a90729e6c757497355a1feee743.tar.xz
kernel-qcow2-util-linux-6cf644cf06468a90729e6c757497355a1feee743.zip
swapon: fix swsuspend detection
Welcome to hell where S1SUSPEND/S2SUSPEND is "swsuspend" in libblkid and "suspend" in libvolume_id Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index 33d2b135f..f0c969b61 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -175,7 +175,16 @@ static int
swap_is_suspend(const char *device) {
const char *type = fsprobe_get_fstype_by_devname(device);
- return (type && strcmp(type, "suspend") == 0) ? 1 : 0;
+ /* S1SUSPEND/S2SUSPEND =
+ *
+ * "swsuspend" in libblkid
+ * "suspend" in libvolume_id
+ */
+ if (type && (strcmp(type, "suspend") == 0 ||
+ strcmp(type, "swsuspend") == 0))
+ return 1;
+
+ return 0;
}
/* calls mkswap */