From 6cf644cf06468a90729e6c757497355a1feee743 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Apr 2008 23:18:36 +0200 Subject: [PATCH] swapon: fix swsuspend detection Welcome to hell where S1SUSPEND/S2SUSPEND is "swsuspend" in libblkid and "suspend" in libvolume_id Signed-off-by: Karel Zak --- mount/swapon.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mount/swapon.c b/mount/swapon.c index 33d2b135..f0c969b6 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 */ -- 2.39.5