From: Karel Zak Date: Tue, 15 Apr 2008 21:18:36 +0000 (+0200) Subject: swapon: fix swsuspend detection X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf644cf06468a90729e6c757497355a1feee743;p=util-linux swapon: fix swsuspend detection Welcome to hell where S1SUSPEND/S2SUSPEND is "swsuspend" in libblkid and "suspend" in libvolume_id Signed-off-by: Karel Zak --- 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 */